aboutsummaryrefslogtreecommitdiff
path: root/src/client/shell/context_menu.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/context_menu.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/context_menu.rs')
-rw-r--r--src/client/shell/context_menu.rs12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/client/shell/context_menu.rs b/src/client/shell/context_menu.rs
index 926510c5..96f57178 100644
--- a/src/client/shell/context_menu.rs
+++ b/src/client/shell/context_menu.rs
@@ -240,8 +240,7 @@ impl ClientShellState {
if let Some(label) = label {
self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay {
title: "rename workspace",
- input: label,
- replace_on_type: false,
+ input: TextEditor::new(&label, false),
target: ClientRenameTarget::Workspace { workspace_id },
}));
}
@@ -322,8 +321,7 @@ impl ClientShellState {
.to_string();
self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay {
title: "new tab",
- input: default_name.clone(),
- replace_on_type: true,
+ input: TextEditor::new(&default_name, true),
target: ClientRenameTarget::NewTab {
workspace_id,
default_name,
@@ -350,8 +348,7 @@ impl ClientShellState {
if let Some(tab) = tab {
self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay {
title: "rename tab",
- input: tab.label.clone(),
- replace_on_type: false,
+ input: TextEditor::new(&tab.label, false),
target: ClientRenameTarget::Tab {
tab_id,
auto_name: !tab.custom_label,
@@ -392,8 +389,7 @@ impl ClientShellState {
});
self.overlay = Some(ClientShellOverlay::Rename(ClientRenameOverlay {
title: "rename pane",
- input: label.clone().unwrap_or_default(),
- replace_on_type: label.is_none(),
+ input: TextEditor::new(label.as_deref().unwrap_or_default(), label.is_none()),
target: ClientRenameTarget::Pane { pane_id },
}));
}