diff options
| author | Mark Jaquith <mark@jaquith.me> | 2026-09-14 15:47:53 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-09-14 21:47:53 +0200 |
| commit | b0f21ed2cb85613050b794bf6c78a7c367a94e0d (patch) | |
| tree | 25c14e09338f5300bedbc8131aa23fab3d37add9 /src/client/shell/tests/copy.rs | |
| parent | d8b36691d10c6055293ad45324b22af8b8f570e5 (diff) | |
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 <jonathan.liebig@gmail.com>
Diffstat (limited to 'src/client/shell/tests/copy.rs')
| -rw-r--r-- | src/client/shell/tests/copy.rs | 11 |
1 files changed, 6 insertions, 5 deletions
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 ") ); } |
