diff options
Diffstat (limited to 'alacritty/src/input.rs')
-rw-r--r-- | alacritty/src/input.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/alacritty/src/input.rs b/alacritty/src/input.rs index 2d865990..58ca42cb 100644 --- a/alacritty/src/input.rs +++ b/alacritty/src/input.rs @@ -208,20 +208,18 @@ impl<T: EventListener> Execute<T> for Action { ctx.terminal_mut().vi_goto_point(*regex_match.start()); } }, - Action::ViAction(ViAction::SearchEndNext) => { - let origin = ctx.terminal().visible_to_buffer(ctx.terminal().vi_mode_cursor.point); - let direction = ctx.search_direction(); - - let regex_match = ctx.terminal().search_next(origin, direction, Side::Right, None); + Action::ViAction(ViAction::SearchStart) => { + let terminal = ctx.terminal(); + let origin = terminal.visible_to_buffer(ctx.terminal().vi_mode_cursor.point); + let regex_match = terminal.search_next(origin, Direction::Left, Side::Left, None); if let Some(regex_match) = regex_match { - ctx.terminal_mut().vi_goto_point(*regex_match.end()); + ctx.terminal_mut().vi_goto_point(*regex_match.start()); } }, - Action::ViAction(ViAction::SearchEndPrevious) => { - let origin = ctx.terminal().visible_to_buffer(ctx.terminal().vi_mode_cursor.point); - let direction = ctx.search_direction().opposite(); - - let regex_match = ctx.terminal().search_next(origin, direction, Side::Right, None); + Action::ViAction(ViAction::SearchEnd) => { + let terminal = ctx.terminal(); + let origin = terminal.visible_to_buffer(ctx.terminal().vi_mode_cursor.point); + let regex_match = terminal.search_next(origin, Direction::Right, Side::Right, None); if let Some(regex_match) = regex_match { ctx.terminal_mut().vi_goto_point(*regex_match.end()); } |