diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-11 02:46:41 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-07-11 02:46:58 +0300 |
| commit | 46174563489273199a17c982356c6e4674ef00d4 (patch) | |
| tree | e87a16bdb34e45b66124732c3458eed1e64d91a0 /src/config | |
| parent | 3b8aeee166d1594e1f8e41631a51748104d76834 (diff) | |
feat: add copy-on-select setting
Diffstat (limited to 'src/config')
| -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 c45f1b7a..16bc595d 100644 --- a/src/config/model.rs +++ b/src/config/model.rs @@ -786,6 +786,8 @@ pub struct UiConfig { pub mobile_width_threshold: u16, /// Capture mouse input for Herdr's mouse UI. Default: true. pub mouse_capture: bool, + /// Copy text selected with the mouse. Default: true. + pub copy_on_select: bool, /// Host cursor policy. Default: auto. pub host_cursor: HostCursorModeConfig, /// Modifier that lets right-click gestures pass through to pane apps. Empty disables it. @@ -989,6 +991,7 @@ impl Default for UiConfig { sidebar_collapsed_mode: SidebarCollapsedModeConfig::Compact, mobile_width_threshold: DEFAULT_MOBILE_WIDTH_THRESHOLD, mouse_capture: true, + copy_on_select: true, host_cursor: HostCursorModeConfig::Auto, right_click_passthrough_modifier: RightClickPassthroughModifierConfig::default(), redraw_on_focus_gained: true, @@ -1399,6 +1402,19 @@ mouse_capture = false } #[test] + fn copy_on_select_default_on_and_parse() { + let default_config = Config::default(); + assert!(default_config.ui.copy_on_select); + + let toml = r#" +[ui] +copy_on_select = false +"#; + let config: Config = toml::from_str(toml).unwrap(); + assert!(!config.ui.copy_on_select); + } + + #[test] fn right_click_passthrough_modifier_defaults_off_and_parses() { let default_config = Config::default(); assert_eq!(default_config.ui.right_click_passthrough_modifiers(), None); |
