Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed backward search from end of word (VSCodeVim #4266) #4294

Merged

Conversation

bdomanski
Copy link
Contributor

Fixed backward search from end of word (VSCodeVim #4266)

  • Searching with 'N' after /e at the end of search fixed
  • Changed comparison for next search result
  • Change made in getNextSearchMatchRange in searchState.ts

What this PR does / why we need it:
Fix the issue reported,

  1. Search for a recurring word and use offset e. E.g. /word/e
  2. The cursor should now be at the end of the next result
  3. Repeat search backwards with N
  4. The cursor is still on the current result

Also fixed the larger issue, where backward search was broken in general. For example, the previous steps could be repeated with ?word?e, where backward search with n also did move the cursor.

Which issue(s) this PR fixes
#4266

Special notes for your reviewer:
We tested this manually to verify it works, please let us know if we should add actual tests to the suite.

- Searching with 'N' after /e at the end of search fixed
- Changed comparison for next search result
- Change made in getNextSearchMatchRange in searchState.ts
@J-Fields
Copy link
Member

Thanks for the PR! A regression test would be great.

@bdomanski
Copy link
Contributor Author

Alright the regression test is up, let me know if everything looks good!

@J-Fields
Copy link
Member

LGTM, thanks for the PR! I noticed while testing that if wrapscan is off, there's still some strangeness, but that can be fixed separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants