mirror of
https://github.com/openai/codex.git
synced 2026-11-28 07:32:19 +00:00
Add Vim search motions to the composer (#41586)
## What changed - Add draft-local forward and backward literal search with `/` and `?`, plus wrapped repeat navigation with `n` and `N`. - Support search motions after delete, change, and yank operators, while keeping queries separate from the draft and skipping atomic elements and partial grapheme matches. - Render and edit the query in the composer footer, highlight matches, and add configurable `tui.keymap.vim_search` bindings to the keymap picker and schema. ## Testing - Cover navigation, wrapping, operator composition, repeat behavior, Unicode graphemes, atomic elements, query editing, paste handling, and rendering. GitOrigin-RevId: 087b080ff8fd74e48456c6b899c07ea5eed38e0c
This commit is contained in:
1 parent
b8c86376a2
commit
63d213884d
27 files changed
+745
-42
No files matched your search
@@ -758,7 +758,7 @@ impl BottomPane {
|
||||
self.request_redraw();
|
||||
}
|
||||
event
|
||||
} else if self.composer.cancel_history_search() {
|
||||
} else if self.composer.cancel_vim_search() || self.composer.cancel_history_search() {
|
||||
self.request_redraw();
|
||||
CancellationEvent::Handled
|
||||
} else if self.composer_is_empty() {
|
||||
@@ -2141,6 +2141,11 @@ mod tests {
|
||||
assert_eq!(pane.composer_text(), "draft");
|
||||
assert!(!pane.composer.popup_active());
|
||||
assert!(!pane.quit_shortcut_hint_visible());
|
||||
pane.composer.set_vim_enabled(/*enabled*/ true);
|
||||
pane.handle_key_event(KeyEvent::new(KeyCode::Char('/'), KeyModifiers::NONE));
|
||||
assert_eq!(CancellationEvent::Handled, pane.on_ctrl_c());
|
||||
assert_eq!(pane.composer_text(), "draft");
|
||||
assert!(!pane.composer.popup_active());
|
||||
}
|
||||
|
||||
// live ring removed; related tests deleted.
|
||||
|
||||
Reference in new issue
Block a user