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.rs | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/client/shell.rs') diff --git a/src/client/shell.rs b/src/client/shell.rs index c6c7f2ed..95ee5e78 100644 --- a/src/client/shell.rs +++ b/src/client/shell.rs @@ -32,8 +32,10 @@ mod scroll; mod settings; mod state; mod surface_patch; +mod text_editor; mod word_selection; mod worktrees; +use text_editor::TextEditor; use word_selection::ClientWordSelection; pub(in crate::client::shell) use render::sidebar; @@ -64,30 +66,6 @@ use crate::protocol::{ #[cfg(test)] use crate::raw_input::RawInputEvent; -fn delete_overlay_word(rename: &mut ClientRenameOverlay) { - if rename.replace_on_type { - rename.input.clear(); - rename.replace_on_type = false; - return; - } - while rename.input.chars().last().is_some_and(char::is_whitespace) { - rename.input.pop(); - } - let Some(word) = rename - .input - .chars() - .last() - .map(|character| character.is_alphanumeric() || character == '_') - else { - return; - }; - while rename.input.chars().last().is_some_and(|character| { - !character.is_whitespace() && (character.is_alphanumeric() || character == '_') == word - }) { - rename.input.pop(); - } -} - fn target_event_message(target: ClientInputTarget, event: ClientPaneInputEvent) -> ClientMessage { match target { ClientInputTarget::Pane(pane_id) => ClientMessage::ClientShellPaneInput { -- cgit v1.2.3