micro-editor / micro-editor/micro
Cursor at the wrong end of selection after deselecting
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
Have two lines of text one below the other, select some text from left to right on one line, then press up/down arrow key.
Eg:

Press down arrow key here
It ends up here
You would expect the cursor to stay in the rightmost position, but it gets reset to the leftmost one instead.
Proposed solution
in the Deselect method, there's currently a start bool property, which decides whether to reset cursor location to the start or end of selection. But in these cases, the cursor.Loc attribute is already pointing at the correct position, so we don't need to reset c.Loc at all.
So instead of a boolean, we can make 3 possible values for it: ResetLocationStart, ResetLocationEnd, and ResetLocationDefault.
Specifications
Version: 2.0.8
Commit hash: cfcb2e45
OS: Linux
Terminal: GNOME Terminal
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
Locate the Deselect method and trace its callers to understand how selection reset and cursor.Loc interact with up/down movement. Reproduce the two-line selection case, then verify that deselecting preserves the cursor's correct end position without regressing cases that reset to the start or end.
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
- 58/100