зеркало из
https://github.com/glebtv/tui-textarea.git
synced 2026-09-07 07:55:50 +03:00
fix e behavior in operator-pending mode of vim example
`e`'s behavior is actually not same as `w`. For example, let's say we have the following text and the cursor is on 'f'. ``` foo bar ``` Then `de` deletes the text 'foo' but `dw` deletes the text 'foo ' including the trailing space.
Этот коммит содержится в:
@@ -116,14 +116,12 @@ impl Vim {
|
|||||||
key: Key::Char('e'),
|
key: Key::Char('e'),
|
||||||
ctrl: false,
|
ctrl: false,
|
||||||
..
|
..
|
||||||
} if matches!(self.mode, Mode::Operator(_)) => {
|
} => {
|
||||||
textarea.move_cursor(CursorMove::WordForward) // `e` behaves like `w` in operator-pending mode
|
textarea.move_cursor(CursorMove::WordEnd);
|
||||||
|
if matches!(self.mode, Mode::Operator(_)) {
|
||||||
|
textarea.move_cursor(CursorMove::Forward); // Include the text under the cursor
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Input {
|
|
||||||
key: Key::Char('e'),
|
|
||||||
ctrl: false,
|
|
||||||
..
|
|
||||||
} => textarea.move_cursor(CursorMove::WordEnd),
|
|
||||||
Input {
|
Input {
|
||||||
key: Key::Char('b'),
|
key: Key::Char('b'),
|
||||||
ctrl: false,
|
ctrl: false,
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user