From 753d05a6e2eed8537b24b7f6787862a09aa9d6c2 Mon Sep 17 00:00:00 2001 From: Braelyn Boynton Date: Tue, 19 Nov 2024 10:32:57 -0800 Subject: [PATCH] cargo fmt --- crates/atuin/src/command/client/search/interactive.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs index 0013bcfff2b..5549cbfd90c 100644 --- a/crates/atuin/src/command/client/search/interactive.rs +++ b/crates/atuin/src/command/client/search/interactive.rs @@ -205,7 +205,8 @@ impl State { let ctrl = input.modifiers.contains(KeyModifiers::CONTROL); let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert); - let cursor_at_end_of_line = self.search.input.position() == UnicodeWidthStr::width(self.search.input.as_str()); + let cursor_at_end_of_line = + self.search.input.position() == UnicodeWidthStr::width(self.search.input.as_str()); let cursor_at_start_of_line = self.search.input.position() == 0; // support ctrl-a prefix, like screen or tmux @@ -223,12 +224,14 @@ impl State { KeyCode::Esc if esc_allow_exit => Some(Self::handle_key_exit(settings)), KeyCode::Char('[') if ctrl && esc_allow_exit => Some(Self::handle_key_exit(settings)), KeyCode::Tab => Some(InputAction::Accept(self.results_state.selected())), - KeyCode::Right if cursor_at_end_of_line => Some(InputAction::Accept(self.results_state.selected())), + KeyCode::Right if cursor_at_end_of_line => { + Some(InputAction::Accept(self.results_state.selected())) + } KeyCode::Left if cursor_at_start_of_line => Some(Self::handle_key_exit(settings)), KeyCode::Char('o') if ctrl => { self.tab_index = (self.tab_index + 1) % TAB_TITLES.len(); Some(InputAction::Continue) - }, + } _ => None, };