micro-editor / micro-editor/micro
Previous search (Ctrl+p) matches left to right instead of right to left
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 29.6k
- Forks
- 1.4k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 10
Description
say I have the following in a text file, and the pipe | represents where my cursor is located
hello hello hello
hello hello hello
| hello hello hello
When I do Ctrl+f and type in hello it finds the next instance starting from my cursor, which is fine. Anytime I press Ctrl+n it goes to the next instance of hello, which is on the same line, which is also fine. Now the bug is when using Ctrl+p. Ctrl+p will search backward (previous lines), match the first instance reading from left to right instead of right to left. So say I represent the matched text with [hello] and square braces and still have the same file.
hello hello hello
hello hello hello
| hello hello hello
Ctrl+f # type in hello
Ctrl+p
#the expected result would be this
hello hello hello
hello hello [hello]
hello hello hello
#not this
hello hello hello
[hello] hello hello
hello hello hello
Version: 1.4.1
Commit hash: 1856891
Compiled on August 10, 2018
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
Reproduce the issue in micro using the Ctrl+f search followed by Ctrl+p on the three-line example, checking which earlier match is selected. Trace the Ctrl+p search entry point and its backward-match behavior; done means the nearest prior match is selected from right to left, while Ctrl+n continues to select the next match correctly.
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
- 30/100