beloglazov / vim-online-thesaurus

A Vim plugin for looking up words in an online thesaurus
Apache License 2.0
247 stars 21 forks source link

Support character-wise visual mode word lookup #31

Open annagrram opened 9 years ago

annagrram commented 9 years ago

Support visual mode word lookup without overriding the unnamed register.

beloglazov commented 9 years ago

I didn't dig deep into it, but with this PR if you invoke the lookup from the visual mode twice, the whole content of the thesaurus buffer gets into the default register. Do you experience this as well?

annagrram commented 9 years ago

Very interesting. And weird. I experience it only when I lookup from visual mode and then lookup regularly. Lookup twice or more from visual mode works well for me.

I'll dig into it and update the PR.

annagrram commented 9 years ago

Ok. I've found and fixed the problem. Actually it was always there, we just missed it.

Because we use deletions in the Lookup function, it overrides the default register. I fixed it by saving and restoring the register.

beloglazov commented 9 years ago

Sorry for taking so long to review your changes. Could you please address my comments? I'll then merge the PR.

annagrram commented 9 years ago

Sorry for not fixing it yet. Busy time at work. I'll take a look at it on the weekend.

beloglazov commented 9 years ago

No worries, I have the same issue :)