diff options
author | Helmut K. C. Tessarek <tessarek@evermeet.cx> | 2024-02-21 03:25:55 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-21 08:25:55 +0000 |
commit | 56b971ae1990f8b03603260801161caf0dfb84d7 (patch) | |
tree | bb6a260859556f2b3ea4dbf0a8f62d74d98f84b1 /atuin-client/src | |
parent | 3d82adad369c47ab99b6fa87dba8797150065b73 (diff) |
feat(client): add config option keys.scroll_exits (#1744)
* feat(client): add config option keys.scroll_exits
If the config option is set the `false`, using the up/down key won't
exit the TUI when scrolled past the first/last entry.
Example:
```
[keys]
scroll_exits = false
```
The default is `true`, which is the current behavior.
* Update atuin/src/command/client/search/interactive.rs
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
* refactor: add option to config.toml
---------
Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
Diffstat (limited to 'atuin-client/src')
-rw-r--r-- | atuin-client/src/settings.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 763fde1b0..ad2e45ecd 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -306,6 +306,11 @@ pub struct Sync { pub records: bool, } +#[derive(Clone, Debug, Deserialize, Default)] +pub struct Keys { + pub scroll_exits: bool, +} + #[derive(Clone, Debug, Deserialize)] pub struct Settings { pub dialect: Dialect, @@ -360,6 +365,9 @@ pub struct Settings { #[serde(default)] pub sync: Sync, + #[serde(default)] + pub keys: Keys, + // This is automatically loaded when settings is created. Do not set in // config! Keep secrets and settings apart. #[serde(skip)] @@ -588,6 +596,7 @@ impl Settings { // New users will get the new default, that is more similar to what they are used to. .set_default("enter_accept", false)? .set_default("sync.records", false)? + .set_default("keys.scroll_exits", true)? .set_default("keymap_mode", "emacs")? .set_default("keymap_mode_shell", "auto")? .set_default("keymap_cursor", HashMap::<String, String>::new())? |