From 24388033a594e664cc1718fda8ba802399b0d038 Mon Sep 17 00:00:00 2001 From: Patrick Decat Date: Sun, 5 Mar 2023 19:36:35 +0100 Subject: Show preview of selected command (#643) * Only show help if terminal strictly has more than one line * There is no border around the input line in compact mode * Add command preview * Dynamic preview height * Avoid extra allocations Co-authored-by: Conrad Ludgate * Address clippy error * Merge normal and compact views code * Add show_preview setting, disabled by default * Convert `bool` to `int` with `if` for legibility --------- Co-authored-by: Conrad Ludgate --- atuin-client/src/settings.rs | 2 ++ 1 file changed, 2 insertions(+) (limited to 'atuin-client/src') diff --git a/atuin-client/src/settings.rs b/atuin-client/src/settings.rs index 2975edba..95b01c86 100644 --- a/atuin-client/src/settings.rs +++ b/atuin-client/src/settings.rs @@ -112,6 +112,7 @@ pub struct Settings { pub filter_mode: FilterMode, pub filter_mode_shell_up_key_binding: FilterMode, pub shell_up_key_binding: bool, + pub show_preview: bool, pub exit_mode: ExitMode, #[serde(with = "serde_regex", default = "RegexSet::empty")] pub history_filter: RegexSet, @@ -296,6 +297,7 @@ impl Settings { .set_default("filter_mode", "global")? .set_default("filter_mode_shell_up_key_binding", "global")? .set_default("shell_up_key_binding", false)? + .set_default("show_preview", false)? .set_default("exit_mode", "return-original")? .set_default("session_token", "")? .set_default("style", "auto")? -- cgit v1.3.1