Chore: 'x' to close help window

This commit is contained in:
Grail Finder
2025-12-04 12:30:00 +03:00
parent 9c6164c227
commit 8f4d8e4722

12
tui.go
View File

@@ -93,10 +93,13 @@ var (
[yellow]n[white]: go to next search result [yellow]n[white]: go to next search result
[yellow]N[white]: go to previous search result [yellow]N[white]: go to previous search result
=== tables (chat history, agent pick, file pick, properties) ===
[yellow]x[white]: to exit the table page
=== status line === === status line ===
%s %s
Press Enter to go back Press <Enter> or 'x' to return
` `
colorschemes = map[string]tview.Theme{ colorschemes = map[string]tview.Theme{
"default": tview.Theme{ "default": tview.Theme{
@@ -644,8 +647,13 @@ func init() {
}) })
helpView.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { helpView.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
switch event.Key() { switch event.Key() {
case tcell.KeyEsc, tcell.KeyEnter: case tcell.KeyEnter:
return event return event
default:
if event.Key() == tcell.KeyRune && event.Rune() == 'x' {
pages.RemovePage(helpPage)
return nil
}
} }
return nil return nil
}) })