matze / vim-move

Plugin to move lines and selections up and down
http://www.vim.org/scripts/script.php?script_id=4687
MIT License
1.2k stars 56 forks source link

Can't move to the right when it finds a tilded character #56

Open gerardbm opened 3 years ago

gerardbm commented 3 years ago

I'm not sure if this is possible to fix, but I can't move a char or a selection to the right side if there's a tilded character, for example:

this line has a tilded character just hére
                                      |

So the movement stops where there's the | symbol.

I checked the functions getpos() and getcurpos() in Vim (Vim-native functions) and of course this is the problem: the third coordinate jumps two numbers after the tilded character.

From [0, 1, 40, 0, 40] to [0, 1, 42, 0, 41], when it should be [0, 1, 41, 0, 41].

If you think it's a Vim issue, it's ok, but I think it's expected on Vim, so it should require a specific solution in plugin-territory.

The issue does not happen going to the left side.

matze commented 3 years ago

I don't really understand the problem. You try move starting from hére or the entire line containing it?

gerardbm commented 3 years ago

The issue appears when you try to move characters or words from the letf to right (horizontally) in the same line. From right to left, it can move perfectly. So it only happens from left to right.