Description
While configuring bindings of tabs and splits while testing the return condition behaviour of Unsplit, I came across this error which I am apparently able to reproduce:
Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:336 (0x563d6cfe07f8)
runtime/panic.go:335 (0x563d6cfe07c6)
github.com/zyedidia/micro/v2/internal/views/splits.go:276 (0x563d6d40fc33)
github.com/zyedidia/micro/v2/internal/views/splits.go:422 (0x563d6d410ad9)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:667 (0x563d6d43a1e5)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:685 (0x563d6d432287)
github.com/zyedidia/micro/v2/internal/action/actions.go:2033 (0x563d6d43219b)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:567 (0x563d6d43969a)
github.com/zyedidia/micro/v2/internal/action/tab.go:224 (0x563d6d437a66)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:183 (0x563d6d437899)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:33 (0x563d6d437831)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:546 (0x563d6d439439)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:464 (0x563d6d438d89)
github.com/zyedidia/micro/v2/internal/action/tab.go:337 (0x563d6d44abb1)
github.com/zyedidia/micro/v2/internal/action/tab.go:141 (0x563d6d449cd3)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:542 (0x563d6d47551d)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:481 (0x563d6d47504f)
internal/runtime/atomic/types.go:194 (0x563d6cfa8695)
runtime/asm_amd64.s:1771 (0x563d6cfe60a1)
It seems there's some timing involved, as the - what I thought of - most simple form to reproduce the error doesn't manifest it. So we need a two step process here:
To keyboard bindings in bindings.json I added:
"F11": "Unsplit|HSplit",
"F12": "Unsplit|VSplit",
After loading micro now, then tapping F11, then F12, or vice versa, the above problem shows.
It will not show when glowing both steps into one single macro, as in:
"F10": "Unsplit|HSplit,Unsplit|VSplit",
reason seems to be that the problem, in order to show, seem to need an already unsplit view, with the next attempt to unsplit bombing then, which is not given in case of single line macro.
Testing this hypothesis with this change:
"F10": "Unsplit|HSplit,Unsplit,Unsplit|VSplit",
indeed causes it to bomb immediately. But simply two Unsplit in sequence in once macro won't show the error,
nor does "HSplit,Unsplit|Unsplit or "HSplit,Unspli,Unsplit.
Environment
- Version: 2.0.15-3
- OS: Debian forky
- Terminal: tilix
Description
While configuring bindings of tabs and splits while testing the return condition behaviour of Unsplit, I came across this error which I am apparently able to reproduce:
Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:336 (0x563d6cfe07f8)
runtime/panic.go:335 (0x563d6cfe07c6)
github.com/zyedidia/micro/v2/internal/views/splits.go:276 (0x563d6d40fc33)
github.com/zyedidia/micro/v2/internal/views/splits.go:422 (0x563d6d410ad9)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:667 (0x563d6d43a1e5)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:685 (0x563d6d432287)
github.com/zyedidia/micro/v2/internal/action/actions.go:2033 (0x563d6d43219b)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:567 (0x563d6d43969a)
github.com/zyedidia/micro/v2/internal/action/tab.go:224 (0x563d6d437a66)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:183 (0x563d6d437899)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:33 (0x563d6d437831)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:546 (0x563d6d439439)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:464 (0x563d6d438d89)
github.com/zyedidia/micro/v2/internal/action/tab.go:337 (0x563d6d44abb1)
github.com/zyedidia/micro/v2/internal/action/tab.go:141 (0x563d6d449cd3)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:542 (0x563d6d47551d)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:481 (0x563d6d47504f)
internal/runtime/atomic/types.go:194 (0x563d6cfa8695)
runtime/asm_amd64.s:1771 (0x563d6cfe60a1)
It seems there's some timing involved, as the - what I thought of - most simple form to reproduce the error doesn't manifest it. So we need a two step process here:
To keyboard bindings in bindings.json I added:
"F11": "Unsplit|HSplit",
"F12": "Unsplit|VSplit",
After loading micro now, then tapping F11, then F12, or vice versa, the above problem shows.
It will not show when glowing both steps into one single macro, as in:
"F10": "Unsplit|HSplit,Unsplit|VSplit",
reason seems to be that the problem, in order to show, seem to need an already unsplit view, with the next attempt to unsplit bombing then, which is not given in case of single line macro.
Testing this hypothesis with this change:
"F10": "Unsplit|HSplit,Unsplit,Unsplit|VSplit",
indeed causes it to bomb immediately. But simply two Unsplit in sequence in once macro won't show the error,
nor does "HSplit,Unsplit|Unsplit or "HSplit,Unspli,Unsplit.
Environment