Improve delete UX and wrap the helpbar on narrow terminals.
Confirm with x, force-delete with X, and wrap keybinding hints so all shortcuts stay visible. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+19
-9
@@ -11,13 +11,15 @@ type KeyMap struct {
|
||||
Project key.Binding
|
||||
Board key.Binding
|
||||
Status key.Binding
|
||||
Edit key.Binding
|
||||
Delete key.Binding
|
||||
Undo key.Binding
|
||||
Redo key.Binding
|
||||
Quit key.Binding
|
||||
Enter key.Binding
|
||||
Escape key.Binding
|
||||
Edit key.Binding
|
||||
Delete key.Binding // x — confirm first
|
||||
DeleteForce key.Binding // X — immediate
|
||||
ConfirmYes key.Binding
|
||||
Undo key.Binding
|
||||
Redo key.Binding
|
||||
Quit key.Binding
|
||||
Enter key.Binding
|
||||
Escape key.Binding
|
||||
}
|
||||
|
||||
// DefaultKeyMap returns the default key bindings.
|
||||
@@ -56,8 +58,16 @@ func DefaultKeyMap() KeyMap {
|
||||
key.WithHelp("e", "edit"),
|
||||
),
|
||||
Delete: key.NewBinding(
|
||||
key.WithKeys("x"),
|
||||
key.WithHelp("x", "delete"),
|
||||
),
|
||||
DeleteForce: key.NewBinding(
|
||||
key.WithKeys("X"),
|
||||
key.WithHelp("X", "delete"),
|
||||
key.WithHelp("X", "force delete"),
|
||||
),
|
||||
ConfirmYes: key.NewBinding(
|
||||
key.WithKeys("y", "Y"),
|
||||
key.WithHelp("y", "confirm"),
|
||||
),
|
||||
Undo: key.NewBinding(
|
||||
key.WithKeys("u", "ctrl+z"),
|
||||
@@ -84,7 +94,7 @@ func DefaultKeyMap() KeyMap {
|
||||
|
||||
// ShortHelp implements help.KeyMap.
|
||||
func (k KeyMap) ShortHelp() []key.Binding {
|
||||
return []key.Binding{k.Up, k.New, k.Search, k.Project, k.Board, k.Status, k.Edit, k.Delete, k.Undo, k.Redo, k.Quit}
|
||||
return []key.Binding{k.Up, k.New, k.Search, k.Project, k.Board, k.Status, k.Edit, k.Delete, k.DeleteForce, k.Undo, k.Redo, k.Quit}
|
||||
}
|
||||
|
||||
// FullHelp implements help.KeyMap.
|
||||
|
||||
Reference in New Issue
Block a user