Crash when type `shift+=` in Editor Example
yanecc opened this issue · 1 comments
yanecc commented
2024/06/04 22:15:25 loaded builtin font face: Go, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go, style: Italic, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go, style: Regular, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go, style: Italic, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Medium, style: Regular, weight: Medium
2024/06/04 22:15:25 loaded builtin font face: Go Medium, style: Italic, weight: Medium
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Regular, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Italic, weight: SemiBold
2024/06/04 22:15:25 loaded builtin font face: Go Mono, style: Italic, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Smallcaps, style: Regular, weight: Normal
2024/06/04 22:15:25 loaded builtin font face: Go Smallcaps, style: Italic, weight: Normal
2024/06/04 22:15:25 registered view: main/Example
2024/06/04 22:15:25 registered view: main/EditorExampleView
2024/06/04 22:15:29 switching to gioview://main/EditorExampleView
panic: regexp: Compile("6ijd|\n_++"): error parsing regexp: invalid nested repetition operator: `++`
goroutine 6 [running]:
regexp.MustCompile({0xc0020f7a30, 0x9})
A:/Scoop/apps/go/current/src/regexp/regexp.go:317 +0xb4
main.stylingText({0xc002247a00, 0x190}, {0xc0020f7a30?, 0x0?})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:110 +0x3d
main.(*EditorExample).Layout.func1.3({{{0x357, 0x0}, {0x357, 0xf4169}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:76 +0x107
gioui.org/layout.Flex.Layout({0x0?, 0x0?, 0x0?, 0x0?}, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/layout/flex.go:99 +0x2b5
main.(*EditorExample).Layout.func1({{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:48 +0x3f7
gioui.org/layout.Inset.Layout({0x5826ac0?, 0xc0?, 0xdfdeb8?, 0x0?}, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/layout/layout.go:169 +0x3a3
github.com/oligo/gioview/page.(*PageStyle).Layout.func1({{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/src/gioview/page/page_style.go:71 +0x65
gioui.org/layout.(*List).Layout(0xc005948e50, {{{0x357, 0x0}, {0x357, 0xf4240}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/layout/list.go:122 +0x158
gioui.org/widget/material.ListStyle.Layout({0xc005948e08, {0xc005948e08, {0x40000000, 0x40000000, {0x0, 0x0, 0x0, 0x0}}, {0x42180000, 0x40c00000, ...}}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/widget/material/list.go:286 +0x208
github.com/oligo/gioview/page.(*PageStyle).Layout(0xc000101810, {{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/src/gioview/page/page_style.go:67 +0x645
main.(*EditorExample).Layout(0x0?, {{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/editor-example.go:44 +0xb1
main.(*HomeView).LayoutMain.func2.3({{{0x366, 0x358}, {0x366, 0x358}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:79 +0x9d
gioui.org/layout.Flex.Layout({0x1e?, 0x0?, 0x0?, 0x0?}, {{{0x366, 0x384}, {0x366, 0x384}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/layout/flex.go:134 +0x635
main.(*HomeView).LayoutMain.func2({{{0x366, 0x384}, {0x366, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, {{0x0, ...}, ...}, ...})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:66 +0x3e5
gioui.org/layout.Flex.Layout({0x40?, 0xe8?, 0x7f?, 0xc0?}, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/pkg/mod/gioui.org@v0.6.0/layout/flex.go:134 +0x635
main.(*HomeView).LayoutMain(0xc0033988d0, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...}, ...)
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:41 +0x23d
main.(*HomeView).Layout(...)
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/home.go:34
main.(*UI).layout(0xc0000e8b00?, {{{0x4b0, 0x384}, {0x4b0, 0x384}}, {0x3fc00000, 0x3fc00000}, {0xc18fe643591ba42c, 0x3b9a68d51, 0x17359a0}, ...})
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:48 +0xdb
main.(*UI).Loop(0xc005827fb8)
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:37 +0x1a5
main.main.func1()
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:61 +0x86
created by main.main in goroutine 1
C:/Users/Sunrise/Documents/Go代码/src/gioview/example/basic/app.go:54 +0x1a
exit status 2
oligo commented
Hi, thanks for your feedback. The crash you reported seems to be caused by the invalid RE, not the library code. You need to escape the + sign by preceding it with a backslash. The example code you are running is for demo purpose only, and may not cover the corner cases.