From c41b4cc5da406af17c7cb26038cba64eebfeb830 Mon Sep 17 00:00:00 2001 From: Pablu Date: Mon, 1 Dec 2025 17:05:10 +0100 Subject: [PATCH] Add ctrl+e to hide and unhide editor --- cmd/sqv-tview/main.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/cmd/sqv-tview/main.go b/cmd/sqv-tview/main.go index 169aae6..79a5154 100644 --- a/cmd/sqv-tview/main.go +++ b/cmd/sqv-tview/main.go @@ -130,7 +130,8 @@ func main() { }) menuHidden := false - verticalFlex.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { + editorHidden := false + horizontalFlex.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey { switch event.Key() { case tcell.KeyCtrlH: if !menuHidden { @@ -141,6 +142,15 @@ func main() { app.SetFocus(menuView) } menuHidden = !menuHidden + case tcell.KeyCtrlE: + if !editorHidden { + horizontalFlex.ResizeItem(sqlEditor, 0, 0) + app.SetFocus(verticalFlex) + } else { + horizontalFlex.ResizeItem(sqlEditor, 0, 1) + app.SetFocus(sqlEditor) + } + editorHidden = !editorHidden } return event