mirror of
https://github.com/openai/codex.git
synced 2026-11-28 07:32:19 +00:00
Add Vim character find and till motions (#40785)
## What changed - Add line-local `f`, `F`, `t`, and `T` motions to Vim normal mode. - Support the motions with `c`, `d`, and `y`, including dot-repeat for changes. - Expose separate configurable normal-mode and operator-motion bindings, while preserving existing custom keymaps that use the new defaults. - Keep character targeting aligned to extended grapheme boundaries and skip embedded composer elements. ## Testing - Cover forward and backward motion and operator ranges, missing and adjacent targets, cancellation, dot-repeat, custom bindings, shifted terminal key events, grapheme clusters, and embedded elements. GitOrigin-RevId: 2610cf9a13538d9ae9b890c01417ca25316c1d60
This commit is contained in:
1 parent
25a6e316c8
commit
98ee29c7cd
16 files changed
+703
-13
No files matched your search
@@ -311,7 +311,7 @@ impl TextArea {
|
||||
}
|
||||
match self.vim_pending {
|
||||
VimPending::None => KeymapContext::VimNormal,
|
||||
VimPending::Replace => KeymapContext::Editor,
|
||||
VimPending::Replace | VimPending::Find { .. } => KeymapContext::Editor,
|
||||
VimPending::Operator(_) => KeymapContext::VimOperator,
|
||||
VimPending::TextObject { .. } => KeymapContext::VimTextObject,
|
||||
}
|
||||
@@ -718,7 +718,7 @@ impl TextArea {
|
||||
self.handle_vim_text_object(operator, scope, event);
|
||||
return;
|
||||
}
|
||||
VimPending::Replace => {
|
||||
VimPending::Replace | VimPending::Find { .. } => {
|
||||
self.handle_vim_pending_command(pending, event);
|
||||
return;
|
||||
}
|
||||
@@ -876,7 +876,7 @@ impl TextArea {
|
||||
self.start_vim_edit(VimAction::Change(VimEditTarget::Line));
|
||||
return true;
|
||||
}
|
||||
false
|
||||
self.handle_vim_operator_command(op, event)
|
||||
}
|
||||
|
||||
fn handle_vim_text_object(
|
||||
|
||||
Reference in new issue
Block a user