From b0f21ed2cb85613050b794bf6c78a7c367a94e0d Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Mon, 14 Sep 2026 15:47:53 -0400 Subject: feat: add cursor-based editing to text inputs (#3698) * feat: add cursor-based editing to text inputs refs #1803 * fix: preserve dialog actions with associated text refs #1803 * refactor: simplify text editor outcomes and tests refs #1803 --------- Co-authored-by: JJ Liebig --- src/client/shell/tests/copy.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/client/shell/tests/copy.rs') diff --git a/src/client/shell/tests/copy.rs b/src/client/shell/tests/copy.rs index c83f7fc6..8ee35f45 100644 --- a/src/client/shell/tests/copy.rs +++ b/src/client/shell/tests/copy.rs @@ -1,10 +1,10 @@ use super::*; #[test] -fn pasted_help_and_copy_queries_strip_control_characters() { +fn pasted_help_and_copy_queries_normalize_single_line_text() { let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); state.overlay = Some(ClientShellOverlay::Help(ClientHelpOverlay { - query: String::new(), + query: TextEditor::default(), search_focused: true, scroll: 0, })); @@ -13,10 +13,11 @@ fn pasted_help_and_copy_queries_strip_control_characters() { assert!(matches!( state.overlay, Some(ClientShellOverlay::Help(ClientHelpOverlay { ref query, .. })) - if query == "workspace" + if query.as_str() == "work space" )); state.overlay = None; + state.mode = ClientShellMode::Copy; state.copy_mode = Some(ClientCopyModeState { pane_id: "pane_1".into(), content_revision: 0, @@ -28,7 +29,7 @@ fn pasted_help_and_copy_queries_strip_control_characters() { selection: None, search_prompt: Some(ClientCopySearchPrompt { direction: crate::api::schema::PaneCopySearchDirection::Forward, - query: String::new(), + query: TextEditor::default(), }), search_query: String::new(), search_direction: None, @@ -47,7 +48,7 @@ fn pasted_help_and_copy_queries_strip_control_characters() { .as_ref() .and_then(|copy_mode| copy_mode.search_prompt.as_ref()) .map(|prompt| prompt.query.as_str()), - Some("needle") + Some("needle ") ); } -- cgit v1.2.3