mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
fix(tui): close completion dialog on ctrl+h (#1005)
This commit is contained in:
parent
636fe0fb64
commit
416daca9c6
1 changed files with 2 additions and 2 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue