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

Pollutes vim's search history #94

Closed
rosshadden opened this issue Sep 19, 2017 · 4 comments
Closed

Pollutes vim's search history #94

rosshadden opened this issue Sep 19, 2017 · 4 comments
Labels
need info Need more information before proceeding

Comments

@rosshadden
Copy link

When this plugin is enabled, doing a simple :w<cr> adds two entries to neovim's search history:

/\s\+$
/[\u0009\u0020\u00a0\u1680\u180e\u2000-\u200b\u202f\u205f\u3000\ufeff]\+$

The result is that after saving a file, hitting n for example to view the next occurrence of a pattern will instead search for \s\+$, which is not found. I suspect based on the pattern this is related to trimming trailing whitespace.

I have had this plugin commented out for about a year and forgot why until I tried it again just now :D. Should be an easy fix though, and I regret not bringing it up back then.

@k-takata
Copy link
Contributor

:keeppatterns might be used for fixing this, it was introduced by Vim 7.4.083.

@cxw42
Copy link
Member

cxw42 commented Jun 9, 2020

@rosshadden Are you still experiencing this issue? Have you experimented with :keeppatterns?

@sroccaserra
Copy link

sroccaserra commented Jul 20, 2021

I looked at editorconfig.vim, and it looks like there is only one place where a search is used (in fact a substitution), and the keeppatterns option is now present (along with winsaveview() a few line above):

It should work as expected for the search pattern? Unfortunately not for the substition string, which seems not to be restored by winrestview().

Also, if I understand the doc, keeppatterns should not be needed in a vimscript function: the last used search pattern and the redo command "." will not be changed by functions?

@rosshadden
Copy link
Author

No it doesn't do it anymore. I'm not sure whether I should close the issue though because it seems like it may be affecting @sroccaserra now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
need info Need more information before proceeding
Projects
None yet
Development

No branches or pull requests

4 participants