diff options
| author | akbash <akbash@herdr.dev> | 2026-07-16 21:57:20 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-07-16 21:57:20 +0300 |
| commit | f43a6d4a5591a0286e01de737be7b3f42416898b (patch) | |
| tree | 9245146f3cc399bc6e8477d43c5de5cf3d3f1a42 /src/app/mod.rs | |
| parent | 616d1dd8125ece4a9102b231864cb4fc4b761497 (diff) | |
fix: preserve selection when auto-copy is disabled (#1496)
refs #1471
Co-authored-by: akbash-bot <300245827+akbash-bot@users.noreply.github.com>
Diffstat (limited to 'src/app/mod.rs')
| -rw-r--r-- | src/app/mod.rs | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/src/app/mod.rs b/src/app/mod.rs index 8909fb1f..578ea0cd 100644 --- a/src/app/mod.rs +++ b/src/app/mod.rs @@ -1392,16 +1392,6 @@ impl App { .clamp(self.state.sidebar_min_width, self.state.sidebar_max_width); self.state.mouse_capture = config.ui.mouse_capture; self.state.copy_on_select = config.ui.copy_on_select; - if !self.state.copy_on_select { - if self.state.mode == Mode::Copy { - self.state.stop_selection_autoscroll_state(); - } else { - self.state.clear_selection(); - } - self.last_pane_click = None; - self.selection_autoscroll_deadline = None; - self.selection_highlight_clear_deadline = None; - } if self.state.redraw_on_focus_gained != config.ui.redraw_on_focus_gained { self.state.request_client_config_reload = true; } @@ -2629,11 +2619,14 @@ mod tests { assert_eq!(app.state.agent_panel_sort, state::AgentPanelSort::Priority); assert!(!app.state.redraw_on_focus_gained); assert!(!app.state.copy_on_select); - assert!(app.state.selection.is_none()); - assert!(app.state.selection_autoscroll.is_none()); - assert!(app.selection_autoscroll_deadline.is_none()); - assert!(app.selection_highlight_clear_deadline.is_none()); - assert!(app.last_pane_click.is_none()); + assert!(app.state.selection.is_some()); + assert!(app.state.selection_autoscroll.is_some()); + assert_eq!(app.selection_autoscroll_deadline, Some(selection_deadline)); + assert_eq!( + app.selection_highlight_clear_deadline, + Some(selection_deadline) + ); + assert!(app.last_pane_click.is_some()); app.state.mode = Mode::Copy; app.state.selection = Some(crate::selection::Selection::range( |
