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/input.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/input.rs')
| -rw-r--r-- | src/client/shell/tests/input.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/shell/tests/input.rs b/src/client/shell/tests/input.rs index 35916ecf..b55cf9a2 100644 --- a/src/client/shell/tests/input.rs +++ b/src/client/shell/tests/input.rs @@ -107,6 +107,15 @@ fn full_host_palette_response_is_sent_as_one_theme_update() { #[test] fn modal_paste_shortcut_modifiers_are_platform_specific() { let key = |code, modifiers| crate::input::TerminalKey::new(code, modifiers); + for macos in [false, true] { + assert!(!input::is_modal_paste_shortcut_for_platform( + &key( + KeyCode::Char('v'), + KeyModifiers::CONTROL | KeyModifiers::ALT + ), + macos + )); + } assert!(input::is_modal_paste_shortcut_for_platform( &key(KeyCode::Char('v'), KeyModifiers::CONTROL), @@ -142,8 +151,7 @@ fn modal_paste_inserts_clipboard_text_through_overlay_text_path() { let mut state = ClientShellState::new(ClientShellConfig::from_config(&Config::default())); state.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay { title: "rename pane", - input: "replace me".into(), - replace_on_type: true, + input: TextEditor::new("replace me", true), target: ClientRenameTarget::Pane { pane_id: "pane_1".into(), }, @@ -159,8 +167,8 @@ fn modal_paste_inserts_clipboard_text_through_overlay_text_path() { assert!(outcome.repaint); assert!(matches!( state.overlay, - Some(ClientShellOverlay::Rename(ClientRenameOverlay { ref input, replace_on_type: false, .. })) - if input == "feature/pasted" + Some(ClientShellOverlay::Rename(ClientRenameOverlay { ref input, .. })) + if input.as_str() == "feature/pasted" )); } |
