aboutsummaryrefslogtreecommitdiffstats
path: root/crates
diff options
context:
space:
mode:
authoreth3lbert <eth3lbert+dev@gmail.com>2024-07-10 15:49:58 +0800
committerGitHub <noreply@github.com>2024-07-10 08:49:58 +0100
commite45979c9af1c15f3ae4bdb69325eafef55dcfb02 (patch)
treefad75192a135e911a55af97bed69cfa85be00520 /crates
parentchore(deps): bump @radix-ui/react-toast from 1.1.5 to 1.2.1 in /ui (#2222) (diff)
downloadatuin-e45979c9af1c15f3ae4bdb69325eafef55dcfb02.zip
fix(tui): Press ctrl-a twice should jump to beginning of line (#2246)
Diffstat (limited to 'crates')
-rw-r--r--crates/atuin/src/command/client/search/interactive.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/crates/atuin/src/command/client/search/interactive.rs b/crates/atuin/src/command/client/search/interactive.rs
index 1676345b..36351c54 100644
--- a/crates/atuin/src/command/client/search/interactive.rs
+++ b/crates/atuin/src/command/client/search/interactive.rs
@@ -206,7 +206,10 @@ impl State {
let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert);
// support ctrl-a prefix, like screen or tmux
- if ctrl && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a')) {
+ if !self.prefix
+ && ctrl
+ && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a'))
+ {
self.prefix = true;
return InputAction::Continue;
}
@@ -301,6 +304,8 @@ impl State {
}
KeyCode::Char('a') => {
self.search.input.start();
+ // This prevents pressing ctrl-a twice while still in prefix mode
+ self.prefix = false;
return InputAction::Continue;
}
_ => {}