diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-25 18:39:44 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-25 18:42:33 +0300 |
| commit | 58bcd76bfdb76ecbb8cfee868dabe60b43f16cc6 (patch) | |
| tree | dad4b122401b87c9bc9b8e5b46b854c9534fc983 /src/config/model.rs | |
| parent | ac9dac0263ba2336710e8fc350600ff8674ebf99 (diff) | |
feat: make focus-gain redraw configurable
refs #282
Diffstat (limited to 'src/config/model.rs')
| -rw-r--r-- | src/config/model.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/config/model.rs b/src/config/model.rs index 35b08582..7434c924 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -259,6 +259,8 @@ pub struct UiConfig { pub sidebar_max_width: u16, /// Capture mouse input for Herdr's mouse UI. Default: true. pub mouse_capture: bool, + /// Force a full host-terminal redraw when the outer terminal regains focus. Default: true. + pub redraw_on_focus_gained: bool, /// Lines to scroll per mouse wheel notch. Default: 3. pub mouse_scroll_lines: Option<NonZeroUsize>, /// Ask for confirmation before closing a workspace. Default: true. @@ -416,6 +418,7 @@ impl Default for UiConfig { sidebar_min_width: 18, sidebar_max_width: 36, mouse_capture: true, + redraw_on_focus_gained: true, mouse_scroll_lines: None, confirm_close: true, prompt_new_tab_name: true, @@ -670,6 +673,19 @@ mouse_capture = false } #[test] + fn redraw_on_focus_gained_default_on_and_parse() { + let default_config = Config::default(); + assert!(default_config.ui.redraw_on_focus_gained); + + let toml = r#" +[ui] +redraw_on_focus_gained = false +"#; + let config: Config = toml::from_str(toml).unwrap(); + assert!(!config.ui.redraw_on_focus_gained); + } + + #[test] fn mouse_scroll_lines_defaults_to_three_and_parses() { let default_config = Config::default(); assert_eq!( |
