mirror of
https://github.com/walles/moar.git
synced 2024-10-26 13:00:40 +03:00
Fix a hang
This commit is contained in:
parent
779f1717aa
commit
19b54159a3
@ -179,7 +179,9 @@ func removeLastChar(s string) string {
|
||||
func (m *PagerModeSearch) onKey(key twin.KeyCode) {
|
||||
switch key {
|
||||
case twin.KeyEscape, twin.KeyEnter:
|
||||
m.searcher <- searchCommandDone
|
||||
if m.searcher != nil {
|
||||
m.searcher <- searchCommandDone
|
||||
}
|
||||
//nolint:gosimple // The linter's advice is just wrong here
|
||||
m.pager.mode = PagerModeViewing{pager: m.pager}
|
||||
|
||||
@ -192,7 +194,9 @@ func (m *PagerModeSearch) onKey(key twin.KeyCode) {
|
||||
m.updateSearchPattern()
|
||||
|
||||
case twin.KeyUp, twin.KeyDown, twin.KeyPgUp, twin.KeyPgDown:
|
||||
m.searcher <- searchCommandDone
|
||||
if m.searcher != nil {
|
||||
m.searcher <- searchCommandDone
|
||||
}
|
||||
//nolint:gosimple // The linter's advice is just wrong here
|
||||
m.pager.mode = PagerModeViewing{pager: m.pager}
|
||||
m.pager.mode.onKey(key)
|
||||
|
Loading…
Reference in New Issue
Block a user