kana / vim-smartword

Vim plugin: Smart motions on words
http://www.vim.org/scripts/script.php?script_id=2470
70 stars 8 forks source link

Support selection=exclusive. #1

Closed inkarkat closed 12 years ago

inkarkat commented 12 years ago

Previously, the visual and operator-pending motions selected too much at the end. Need to adjust the new position by moving one character to the left. Note that neither this nor the existing s:current_char take multi-byte characters into consideration.

kana commented 12 years ago

Thank you. I'll look into later.

kana commented 12 years ago

I've never used Vim with &selection ==# 'exclusive', so that I did not notice the problem.

I've looked into your patch and the problem. But your patch doesn't solve the problem properly.

It's a bit tricky to fix the problem. I'll refine the patch later.

kana commented 12 years ago

I've refined your patch as follows: https://github.com/kana/vim-smartword/compare/b8680b309249dc52af5e296de3350e6e53a3a6f4...fix-selection-exclusive

Thank you for the pull request.

inkarkat commented 12 years ago

Oh, that's nice. Thank you very much! I've briefly verified that your revised patch works as expected with &selection ==# 'exclusive'.

I'm also impressed by the use of your vim-vspec testing framework; not many plugin authors do automated testing. This looks really helpful, especially for corner cases such as this.

-- regards, ingo