Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,23 @@ You can find its changes [documented below](#060---2025-10-06).

This release has an [MSRV] of 1.82.

### Migration

The `move_*` methods on `PlainEditorDrv` now have a `bool` parameter, pass `false` for their previous behavior. The `select_*` selection extending methods on `PlainEditorDrv` have been removed, instead use the corresponding `move_*` methods passing `true`.

### Changed

#### Parley

-- Breaking change: The `move_*` methods on `PlainEditorDrv` now take an `extend: bool` parameter. For their previous behavior use `false`. When `extend` is `true` they extend the selection range, following the behaviour of the removed `select_*` methods. ([#459][] by [@ickshonpe][])

### Removed

#### Parley

- The methods `extend_selection_to_point`, `extend_selection_to_byte`, `select_to_text_start`, `select_to_hard_line_start`, `select_to_text_end`, `select_to_hard_line_end`, `select_to_line_end`, `select_up`, `select_down`, `select_left`, `select_right`, `select_word_left` and `select_word_right` have been removed from `PlainEditorDriver`. ([#459][] by [@ickshonpe][])


## [0.6.0] - 2025-10-06

This release has an [MSRV] of 1.82.
Expand Down Expand Up @@ -283,6 +300,7 @@ This release has an [MSRV][] of 1.70.
[@wfdewith]: https://github.com/wfdewith
[@xorgy]: https://github.com/xorgy
[@xStrom]: https://github.com/xStrom
[@ickshonpe]: https:://github.com/ickshonpe

[#54]: https://github.com/linebender/parley/pull/54
[#55]: https://github.com/linebender/parley/pull/55
Expand Down Expand Up @@ -368,6 +386,7 @@ This release has an [MSRV][] of 1.70.
[#413]: https://github.com/linebender/parley/pull/413
[#414]: https://github.com/linebender/parley/pull/414
[#418]: https://github.com/linebender/parley/pull/418
[#459]: https://github.com/linebender/parley/pull/459

[Unreleased]: https://github.com/linebender/parley/compare/v0.5.0...HEAD
[0.5.0]: https://github.com/linebender/parley/compare/v0.4.0...v0.5.0
Expand Down
56 changes: 12 additions & 44 deletions examples/vello_editor/src/text.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,71 +159,39 @@ impl Editor {
}
Key::Named(NamedKey::ArrowLeft) => {
if action_mod {
if shift {
drv.select_word_left();
} else {
drv.move_word_left();
}
} else if shift {
drv.select_left();
drv.move_word_left(shift);
} else {
drv.move_left();
drv.move_left(shift);
}
}
Key::Named(NamedKey::ArrowRight) => {
if action_mod {
if shift {
drv.select_word_right();
} else {
drv.move_word_right();
}
} else if shift {
drv.select_right();
drv.move_word_right(shift);
} else {
drv.move_right();
drv.move_right(shift);
}
}
Key::Named(NamedKey::ArrowUp) => {
if shift {
drv.select_up();
} else {
drv.move_up();
}
drv.move_up(shift);
}
Key::Named(NamedKey::ArrowDown) => {
if shift {
drv.select_down();
} else {
drv.move_down();
}
drv.move_down(shift);
}
Key::Named(NamedKey::Home) => {
if action_mod {
if shift {
drv.select_to_text_start();
} else {
drv.move_to_text_start();
}
} else if shift {
drv.select_to_line_start();
drv.move_to_text_start(shift);
} else {
drv.move_to_line_start();
drv.move_to_line_start(shift);
}
}
Key::Named(NamedKey::End) => {
let this = &mut *self;
let mut drv = this.driver();

if action_mod {
if shift {
drv.select_to_text_end();
} else {
drv.move_to_text_end();
}
} else if shift {
drv.select_to_line_end();
drv.move_to_text_end(shift);
} else {
drv.move_to_line_end();
drv.move_to_line_end(shift);
}
}
Key::Named(NamedKey::Delete) => {
Expand Down Expand Up @@ -277,7 +245,7 @@ impl Editor {
if state.modifiers.shift() {
drv.shift_click_extension(cursor_pos.0, cursor_pos.1);
} else {
drv.move_to_point(cursor_pos.0, cursor_pos.1);
drv.move_to_point(cursor_pos.0, cursor_pos.1, false);
}
}
}
Expand All @@ -291,7 +259,7 @@ impl Editor {
);
self.cursor_reset();
self.driver()
.extend_selection_to_point(cursor_pos.0, cursor_pos.1);
.move_to_point(cursor_pos.0, cursor_pos.1, true);
}
_ => {}
}
Expand Down
Loading