Skip to content

Commit

Permalink
always pass event to primitive when viewing file content
Browse files Browse the repository at this point in the history
fixes #53
  • Loading branch information
dundee committed May 10, 2021
1 parent 669441c commit 9acae2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tui/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import (
)

func (ui *UI) keyPressed(key *tcell.EventKey) *tcell.EventKey {
if ui.pages.HasPage("file") {
return key // send event to primitive
}

if key.Key() == tcell.KeyEsc || key.Rune() == 'q' {
if ui.pages.HasPage("help") {
ui.pages.RemovePage("help")
_, page := ui.pages.GetFrontPage()
ui.app.SetFocus(page)
return nil
}
if ui.pages.HasPage("file") {
return key // send event to primitive
}
}

switch key.Rune() {
Expand Down

0 comments on commit 9acae2b

Please sign in to comment.