Backward Search "?" scrolls the screen with no need and to a wrong location
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
Backward Search - "?" - scrolls the document when followed by a certain first character, when adding the second character it scrolls back
To Reproduce
Steps to reproduce the behavior:
- Edit a large enough document
- Press '?'
- Press 's'
- Screen will scroll to another location (in my case over 100 lines before in the document)
- Press yet another character
- Screen will scroll back
Also, if after step 4 you'll press Enter, it will not find the correct 's' but another much earlier in the document.
And on step 3, the following characters seem to cause a similar behavior - t, o, i, r, e, a maybe more. But some letters don't - p, u, w, c, v, b, n, m.
Note that when a character is not on the screen then vscode vim scrolls to that character as it is pressed (unlike standard vim). But this issue is about the case when there is a character on the screen and still vscode vim scrolls to another much more distant location.
Expected behavior
'?' should not scroll the document at all when writing the search term (as in standard vim), but even if it does not arbitrarily to a far location but rather to a relevant one.
Screenshots
N/A
Environment (please complete the following information):
- Extension (VsCodeVim) version: 1.22.2
- VSCode version: 1.65.2
- OS: MacOS 11.6.5
Contributor guide
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 reproducing backward search with '?' followed by 's' in a large document using VSCode Vim 1.22.2, then inspect the backward-search handling and related editor scrolling behavior. Done means typing the search term does not jump to a distant match and pressing Enter selects the relevant occurrence, consistent with standard Vim.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100