t9md / atom-vim-mode-plus

vim-mode improved
https://atom.io/packages/vim-mode-plus
MIT License
1.4k stars 112 forks source link

Improve word motion, make it independent from Atom's native cursor motion. #953

Closed t9md closed 6 years ago

t9md commented 6 years ago

In atom-v1.23.0-beta, many word-motion family broken. Ultimate cause of why broken is it depends on atom's word motion commands.

But these commands are optimized. And some command no longer continue to find till [0, 0] or EOF. It's OK, vmp should NOT use these method for different purpose.

This PR is to make vmp's word-motion robust, independent from atom's cursor command so that no longer be broken in future update of Atom.

Done

Most work is done by utils.findWord utility function. Which doesn't use native cursor's method, it just search buffer to find regex match. So less chances to be broken on future update of Atom-core 🍻

As a result of more independent word position finding, https://github.com/t9md/atom-vim-mode-plus/issues/946 is also fixed in this PR without waiting for atom-core beta update.