Add ctrl+e to hide and unhide editor
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user