walles / moar

Moar is a pager. It's designed to just do the right thing without any configuration.
Other
647 stars 18 forks source link

Crash #12

Closed walles closed 4 years ago

walles commented 5 years ago
Please post the following crash report at <https://github.com/walles/moar/issues>,
or e-mail it to johan.walles@gmail.com.

Version: 0.9.8-4-g719942c
LANG   : sv_SE.UTF-8
TERM   : xterm-256color

GOOS    : darwin
GOARCH  : amd64
Compiler: gc
NumCPU  : 8

panic: error parsing regexp: invalid UTF-8: `�` [recovered]
    panic: error parsing regexp: invalid UTF-8: `�` [recovered]
    panic: error parsing regexp: invalid UTF-8: `�`

goroutine 1 [running]:
main.main.func1()
    /Users/walles/src/moar/moar.go:85 +0x548
panic(0x118e2c0, 0xc00044e320)
    /usr/local/Cellar/go/1.12.9/libexec/src/runtime/panic.go:522 +0x1b5
main._StartPaging.func1(0x11efe00, 0xc00012c000, 0xc0000a8720)
    /Users/walles/src/moar/moar.go:160 +0x110
panic(0x118e2c0, 0xc00044e320)
    /usr/local/Cellar/go/1.12.9/libexec/src/runtime/panic.go:522 +0x1b5
github.com/walles/moar/m.ToPattern(0xc000478430, 0x5, 0x11c6d60)
    /Users/walles/src/moar/m/pager.go:398 +0x236
github.com/walles/moar/m.(*_Pager)._UpdateSearchPattern(0xc000098180)
    /Users/walles/src/moar/m/pager.go:352 +0x38
github.com/walles/moar/m.(*_Pager)._OnSearchKey(0xc000098180, 0xc00009c190, 0xc0000a007f)
    /Users/walles/src/moar/m/pager.go:412 +0x5e
github.com/walles/moar/m.(*_Pager)._OnKey(0xc000098180, 0xc00009c190, 0xc00044007f)
    /Users/walles/src/moar/m/pager.go:441 +0x268
github.com/walles/moar/m.(*_Pager).StartPaging(0xc000098180, 0xc00009c190, 0x11efe00, 0xc00012c000)
    /Users/walles/src/moar/m/pager.go:606 +0x274
main._StartPaging(0xc00009c0f0)
    /Users/walles/src/moar/moar.go:172 +0x15a
main.main()
    /Users/walles/src/moar/moar.go:111 +0x55d
walles commented 4 years ago

Repro:

  1. Start moar on some file
  2. / to start searching
  3. Type a non-ASCII character to search for, like ö for example
  4. Press Backspace to erase the search character
  5. Boom!

Reproed with 0.9.9.