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

Use @" register instead of @s #1

Closed wellle closed 9 years ago

wellle commented 10 years ago

Previously gv"sy yanked not only into register @s, but also into register @", while only @s gets restored afterwards.

To confirm this, yank some text into @" with yiw, visually select and search some other text v$* and paste with p. This will not paste the originally yanked word.

This pull request uses and restores the @" register instead. The above example pastes the originally yanked word as expected.

wellle commented 9 years ago

I'm willing to fix the conflicts if there's interest.

bronson commented 9 years ago

Your analysis sounds right on. I'm interested.

bronson commented 9 years ago

Any chance you could see how this affects #2? They might be related?

guywithnose commented 9 years ago

I'm pretty sure #2 is unrelated. The code it deletes is not related to anything.

guywithnose commented 9 years ago

Should line 6 change to

normal! gvy
wellle commented 9 years ago

@bronson: I updated my commit on top of current master.

Since I agree with @guywithnose on #2 I cherry picked his commit and solved the conflicts from that too.

bronson commented 9 years ago

Phenomenal. Thank you @wellle and @guywithnose. I'm glad you both understand this code, I'm rapidly forgetting how it all works...