mirror of
https://github.com/walles/moar.git
synced 2024-08-16 23:40:35 +03:00
Fix a hang
This commit is contained in:
parent
e9bc0dffda
commit
c8b4ecf38a
@ -179,7 +179,9 @@ func removeLastChar(s string) string {
|
|||||||
func (m *PagerModeSearch) onKey(key twin.KeyCode) {
|
func (m *PagerModeSearch) onKey(key twin.KeyCode) {
|
||||||
switch key {
|
switch key {
|
||||||
case twin.KeyEscape, twin.KeyEnter:
|
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
|
//nolint:gosimple // The linter's advice is just wrong here
|
||||||
m.pager.mode = PagerModeViewing{pager: m.pager}
|
m.pager.mode = PagerModeViewing{pager: m.pager}
|
||||||
|
|
||||||
@ -192,7 +194,9 @@ func (m *PagerModeSearch) onKey(key twin.KeyCode) {
|
|||||||
m.updateSearchPattern()
|
m.updateSearchPattern()
|
||||||
|
|
||||||
case twin.KeyUp, twin.KeyDown, twin.KeyPgUp, twin.KeyPgDown:
|
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
|
//nolint:gosimple // The linter's advice is just wrong here
|
||||||
m.pager.mode = PagerModeViewing{pager: m.pager}
|
m.pager.mode = PagerModeViewing{pager: m.pager}
|
||||||
m.pager.mode.onKey(key)
|
m.pager.mode.onKey(key)
|
||||||
|
Loading…
Reference in New Issue
Block a user