mirror of
https://github.com/atuinsh/atuin.git
synced 2024-11-22 08:13:57 +01:00
feat(tui): configurable prefix character (#2157)
* feat(tui): configurable prefix character * string not char because toml/json lol
This commit is contained in:
parent
4dd76d84ed
commit
7984f9ef0c
@ -330,6 +330,7 @@ pub struct Sync {
|
|||||||
#[derive(Clone, Debug, Deserialize, Default, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Default, Serialize)]
|
||||||
pub struct Keys {
|
pub struct Keys {
|
||||||
pub scroll_exits: bool,
|
pub scroll_exits: bool,
|
||||||
|
pub prefix: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||||
@ -715,6 +716,7 @@ impl Settings {
|
|||||||
.set_default("enter_accept", false)?
|
.set_default("enter_accept", false)?
|
||||||
.set_default("sync.records", false)?
|
.set_default("sync.records", false)?
|
||||||
.set_default("keys.scroll_exits", true)?
|
.set_default("keys.scroll_exits", true)?
|
||||||
|
.set_default("keys.prefix", "a")?
|
||||||
.set_default("keymap_mode", "emacs")?
|
.set_default("keymap_mode", "emacs")?
|
||||||
.set_default("keymap_mode_shell", "auto")?
|
.set_default("keymap_mode_shell", "auto")?
|
||||||
.set_default("keymap_cursor", HashMap::<String, String>::new())?
|
.set_default("keymap_cursor", HashMap::<String, String>::new())?
|
||||||
|
@ -204,7 +204,7 @@ impl State {
|
|||||||
let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert);
|
let esc_allow_exit = !(self.tab_index == 0 && self.keymap_mode == KeymapMode::VimInsert);
|
||||||
|
|
||||||
// support ctrl-a prefix, like screen or tmux
|
// support ctrl-a prefix, like screen or tmux
|
||||||
if ctrl && input.code == KeyCode::Char('a') {
|
if ctrl && input.code == KeyCode::Char(settings.keys.prefix.chars().next().unwrap_or('a')) {
|
||||||
self.prefix = true;
|
self.prefix = true;
|
||||||
return InputAction::Continue;
|
return InputAction::Continue;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user