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

Searching backwards with offset is unaware of current word under cursor #4266

Closed
spoike opened this issue Nov 15, 2019 · 4 comments
Closed

Comments

@spoike
Copy link

spoike commented Nov 15, 2019

Describe the bug
Apparently searching backwards using an offset doesn't seem to take in account for the current search result under the cursor.

To Reproduce
Steps to reproduce the behavior:

  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

Expected behavior
The cursor should go to the previous result with the cursor at the end of it

Screenshots
N/A

Environment (please complete the following information):

  • Extension (VsCodeVim) version: 1.11.3
  • VSCode version: 1.40.0
  • OS: MacOS Mojave 10.14.6

Additional context
Doing the same steps in vim8 will move the cursor to the end of the previous result.

@J-Fields
Copy link
Member

I'm assigning this to myself since I implemented the original feature and so I remember to actually fix this. If someone wants to give it a go before I get around to it, just give me a heads up.

@bdomanski
Copy link
Contributor

Hi, me and @micklett are working on an open source project for one of our classes and would like to take a look at this! We would hope to have a pull request in the next week.

@J-Fields
Copy link
Member

@bdomanski Amazing! I'll assign this issue to you - feel free to bug me if you've got questions about the code base.

@J-Fields J-Fields assigned bdomanski and unassigned J-Fields Nov 21, 2019
J-Fields pushed a commit that referenced this issue Nov 24, 2019
* Fixed backward search from end of word

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

* Regression test for fixed searching functionality

- Searches '/two/e' then types 'N' and checks cursor moved accordingly
@J-Fields
Copy link
Member

Fixed by #4294

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

No branches or pull requests

3 participants