micro-editor / micro-editor/micro
Unbinding a key doesn't work in some cases
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
For example, after running the following commands:
bind "Ctrl-D" "FindNext"
unbind "Ctrl-D"
Ctrl-D still triggers FindNext instead of its default action DuplicateLine.
The reason is that in DefaultBindings() in defaults_other.go it is specified as "CtrlD", not "Ctrl-D".
In other words, there is no 1-to-1 correspondence between events and their name strings. E.g. "CtrlD", "Ctrl-D" and "Ctrl-d" are all the same event.
So in bindings.go we should search bindings not by event name strings (as we do now, using DefaultBindings() and config.Bindings) but rather by Event structures.
Specifications
Commit hash: 55e9759
OS: Debian 9.12
Terminal: xfce4-terminal, xterm
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading bindings.go and DefaultBindings() in defaults_other.go, then trace how unbind resolves event names. Check how equivalent names such as "CtrlD", "Ctrl-D", and "Ctrl-d" are represented by Event structures. Done means unbinding a key removes the binding regardless of which equivalent name was used, preserving the default action.
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
- Clearly specified
- Newbie friendliness
- 48/100