1
1
mirror of https://github.com/walles/moar.git synced 2024-11-26 13:46:16 +03:00

Allow 'q' to exit Go to Line

I keep pressing 'q' to do this but it never worked...
This commit is contained in:
Johan Walles 2023-02-19 03:15:04 +01:00
parent 128250dbfe
commit 742a6ac7e3

View File

@ -47,6 +47,11 @@ func (p *Pager) onGotoLineKey(key twin.KeyCode) {
} }
func (p *Pager) onGotoLineRune(char rune) { func (p *Pager) onGotoLineRune(char rune) {
if char == 'q' {
p.mode = _Viewing
return
}
newGotoLineString := p.gotoLineString + string(char) newGotoLineString := p.gotoLineString + string(char)
_, err := strconv.Atoi(newGotoLineString) _, err := strconv.Atoi(newGotoLineString)
if err != nil { if err != nil {