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

Does not support nowrapscan #3155

Closed
jnothstine opened this issue Oct 21, 2018 · 9 comments
Closed

Does not support nowrapscan #3155

jnothstine opened this issue Oct 21, 2018 · 9 comments

Comments

@jnothstine
Copy link

Describe the bug
VIM has a nowrapscan option that stops searches when the end of the file is reached, as opposed to continuing back to the top of the file

To Reproduce
Steps to reproduce the behavior:

  1. Search for an item with /
  2. Press n, continue pressing n
  3. When the bottom of the fie is reached, the search goes back to the top of the file

Expected behavior
When the bottom of the file is reached, the search should stop if nowrapscan can be set.

@contrib15
Copy link
Contributor

I really like the 'nowrapscan' feature of Vim because I often miss the 'search wrapping' message and start reading a second time a line that I have already read. It is also very handy when searching for a symbol from the current position to the end of file. It would be very nice to have this feature in Vscodevim!

@XiaoXiaoLui
Copy link

I can't believe it that so few people cares about this feature.
When I search in vim, I don't need to care about the status bar and can concentrate on the text. Also, if I want to do wrapscan at the last match, I can just press "ggn" So there's no reason to turn on wrapscan for me.
However, with wrapscan on, I need to pay attension to the status bar to know if it have reach the end.
This is really annoying.

@juanlanus
Copy link

I care about being able to disable wrapscan, and I'm looking forward for it.
It enhances vim usability.
It protects the user from some of his errors, like evaluating that there are no more instances of the searched text when there actually are.
With nowrapscan one can search repeatedly until after the editor complains, and that's it. The software checks if there are no instances left, not the human or the developer.

@jnothstine
Copy link
Author

jnothstine commented Jul 23, 2019 via email

@J-Fields
Copy link
Member

J-Fields commented Jul 23, 2019

@jnothstine Where's the PR for this? I don't see one and am happy to implement this if there isn't an existing PR.
Nevermind, it's listed above. Was closed by author before being merged though.

@jnothstine
Copy link
Author

jnothstine commented Jul 24, 2019 via email

@contrib15
Copy link
Contributor

Partially inspired by aborted PR #3192, here is a patched version of searchState.js file that seems to do the trick : searchState.zip.

It replaces the file extensions/vscodevim.vim-1.10.0/out/src/state/searchState.js.

Wrapscan can be turned on by changing line 223 to wrapscan = true.

@J-Fields
Copy link
Member

@contrib15 any interest in submitting a PR?

@contrib15
Copy link
Contributor

@J-Fields I will try but probably will need some help.

contrib15 pushed a commit to contrib15/Vim that referenced this issue Sep 2, 2019
J-Fields pushed a commit that referenced this issue Sep 4, 2019
Fixes issue #3155 'Does not support nowrapscan'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants