bronson / vim-visual-star-search

Start a * or # search from a visual block
http://got-ravings.blogspot.com/2008/07/vim-pr0n-visual-search-mappings.html
181 stars 36 forks source link

preserve "* register's content #13

Open snipervld opened 2 years ago

snipervld commented 2 years ago

At the moment, when we do visual star search, "" register's content is saved before search and restored after it.

If we set unnamed to clipboard option, (from :help clipboard) "" register is the same as the "* register. This leads to the problem, where this plugin changes (via normal! gvy command) not only "" register, but "* too. When we restore "" register, "* register is not affected, so it's not restored, unlike standard vim's * behaviour.

This PR resolves described issue by saving "* register's content and restoring it later (just like we do for "")