micro-editor / micro-editor/micro

Reproducible panic: ToggleHelp from CommandMode

Open
#2,390 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
29.6k
Forks
1.4k
Avg merge
2d 18h
Merged PRs (30d)
10

Description

Description of the problem or steps to reproduce

Create a binding to ToggleHelp from CommandMode, then do so.

❯ cat .config/micro/bindings.json
{
    "command": {
        "Ctrl-g": "ToggleHelp"
    }
}

❯ micro # enter CommandMode (Ctrl-e), then ToggleHelp (Ctrl-g)
Micro encountered an error: runtime.errorString runtime error: invalid memory address or nil pointer dereference
runtime/panic.go:221 (0x559729ee0347)
runtime/panic.go:220 (0x559729ee0317)
github.com/zyedidia/micro/v2/internal/views/splits.go:409 (0x55972a30c775)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:548 (0x55972a32fff9)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:559 (0x55972a33345a)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:559 (0x55972a333414)
github.com/zyedidia/micro/v2/internal/action/actions.go:1419 (0x55972a328bad)
github.com/zyedidia/micro/v2/internal/action/bufpane.go:26 (0x55972a33afb6)
github.com/zyedidia/micro/v2/internal/action/infopane.go:137 (0x55972a33b952)
github.com/zyedidia/micro/v2/internal/action/infopane.go:93 (0x55972a33b4fe)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:443 (0x55972a36acb3)
github.com/zyedidia/micro/v2/cmd/micro/micro.go:382 (0x55972a36a84a)
runtime/proc.go:255 (0x559729ecd0c7)
runtime/asm_amd64.s:1581 (0x559729efb581)
 
If you can reproduce this error, please report it at https://github.com/zyedidia/micro/issues

Specifications

Was able to reproduce for the latest binary release (v2.0.10) and latest commit (2f4675e):
Commit hash: b9763856, 2f4675e
OS: Linux (Arch)
Terminal: kitty

Was also able to reproduce the panic in a Windows 10 VM with the latest binary release.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the panic by binding ToggleHelp in CommandMode, then start at internal/views/splits.go:409 and follow the calls through internal/action/bufpane.go:548-559 and actions.go:1419. Check the behavior on the reported Linux and Windows scenarios; done means ToggleHelp no longer panics when invoked from CommandMode.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.