summaryrefslogtreecommitdiff
path: root/src/client/shell.rs
diff options
context:
space:
mode:
authorMark Jaquith <mark@jaquith.me>2026-09-14 15:47:53 -0400
committerGitHub <noreply@github.com>2026-09-14 21:47:53 +0200
commitb0f21ed2cb85613050b794bf6c78a7c367a94e0d (patch)
tree25c14e09338f5300bedbc8131aa23fab3d37add9 /src/client/shell.rs
parentd8b36691d10c6055293ad45324b22af8b8f570e5 (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.rs')
-rw-r--r--src/client/shell.rs26
1 files changed, 2 insertions, 24 deletions
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 {