zyedidia / micro

A modern and intuitive terminal-based text editor
https://micro-editor.github.io
MIT License
24.42k stars 1.16k forks source link

nzw #3160

Open Taoalex542 opened 4 months ago

Taoalex542 commented 4 months ago

Description of the problem or steps to reproduce

if you split the terminal and Unsplit with the original terminal being split first, then unsplit again, the next action will make micro crash

Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference /usr/lib/golang/src/runtime/panic.go:260 (0x5605f04b7a9d) panicmem: panic(memoryError) /usr/lib/golang/src/runtime/panic.go:259 (0x5605f04b7a6d) panicmem: panicCheck2("invalid memory address or nil pointer dereference") /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/views/splits.go:460 (0x5605f090a8b9) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/actions.go:1619 (0x5605f09283dd) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/bufpane.go:466 (0x5605f092e4d7) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/bufpane.go:149 (0x5605f092d1b6) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/bufpane.go:31 (0x5605f092bd1d) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/bufpane.go:449 (0x5605f092e219) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/bufpane.go:365 (0x5605f092dda5) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/tab.go:254 (0x5605f093d70e) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/internal/action/tab.go:136 (0x5605f093d07c) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/cmd/micro/micro.go:445 (0x5605f096ac30) /builddir/build/BUILD/micro-2.0.11/_build/src/github.com/zyedidia/micro/cmd/micro/micro.go:382 (0x5605f096a68a) /usr/lib/golang/src/runtime/internal/atomic/types.go:194 (0x5605f04a3f72) (*Uint32).Load: return Load(&u.value) /usr/lib/golang/src/runtime/asm_amd64.s:1598 (0x5605f04d4481) goexit: BYTE $0x90 // NOP

Specifications

Commit hash: 59dda01cb7ad92a069068b3aa93abc7ff04cc935 OS: Fedora 38 Terminal: zsh

dmaluka commented 4 months ago

I can't reproduce this crash, but I'm not sure what do you mean by "Unsplit with the original terminal being split first". Could you describe your precise steps to reproduce it?

Also:

Commit hash: 59dda01

59dda01 is the current newest top-of-tree, but from your log it looks like the crash happened on v2.0.11. Right?

dmaluka commented 4 months ago

So, I haven't been able reproduce this crash (with either newest micro or v2.0.11). But I can see other problems with the Unsplit action:

So with its current (not documented) behavior, this Unsplit action looks completely useless: the Quit action also closes the current split pane, and does it more correctly.