diff options
| author | Joohoon Cha <[email protected]> | 2025-07-15 20:24:05 +0900 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-07-15 06:24:05 -0500 |
| commit | 416daca9c613c15684081dbe8102d61318b5d36b (patch) | |
| tree | 6dea4601cb87ae91b3c35d09d7e2cd23bf4743ef | |
| parent | 636fe0fb6407f35f55088caaf0facc3cd4c91f70 (diff) | |
| download | opencode-416daca9c613c15684081dbe8102d61318b5d36b.tar.gz opencode-416daca9c613c15684081dbe8102d61318b5d36b.zip | |
fix(tui): close completion dialog on ctrl+h (#1005)
| -rw-r--r-- | packages/tui/internal/components/dialog/complete.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/packages/tui/internal/components/dialog/complete.go b/packages/tui/internal/components/dialog/complete.go index 9da79472d..32fb1854c 100644 --- a/packages/tui/internal/components/dialog/complete.go +++ b/packages/tui/internal/components/dialog/complete.go @@ -139,7 +139,7 @@ var completionDialogKeys = completionDialogKeyMap{ key.WithKeys("tab", "enter", "right"), ), Cancel: key.NewBinding( - key.WithKeys(" ", "esc", "backspace", "ctrl+c"), + key.WithKeys(" ", "esc", "backspace", "ctrl+h", "ctrl+c"), ), } @@ -230,7 +230,7 @@ func (c *completionDialogComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { width := lipgloss.Width(value) triggerWidth := lipgloss.Width(c.trigger) // Only close on backspace when there are no characters left, unless we're back to just the trigger - if msg.String() != "backspace" || (width <= triggerWidth && value != c.trigger) { + if (msg.String() != "backspace" && msg.String() != "ctrl+h") || (width <= triggerWidth && value != c.trigger) { return c, c.close() } } |
