The right shift of a block is not performed well in certain situations if 'enc' is set to a multi-byte value.
Observe it by editing a file with the following contents in Vim (1 and 2 are line numbers, not the contents of the file): #v+ 1 s| 2 | #v- $ vim -u NONE -U NONE --noplugin file.txt :set enc=utf-8 number list listchars=tab:>- :1 :normal 2| :normal j>gv> The result is (note that the '|' characters are not in the same column): #v+ 1 s | 2 | #v- If you change the steps to: :set enc=utf-8 number list listchars=tab:>- :1 :normal 2| :normal j>gv>gv> The result will be (the '|' character in the second line stops moving): #v+ 1 s | 2 | #v- The attached patch fixes the problem. -- Cheers, Lech --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
diff --git a/src/ops.c b/src/ops.c index e5db313..d5dad80 100644 --- a/src/ops.c +++ b/src/ops.c @@ -422,6 +422,7 @@ shift_block(oap, amount) #ifdef FEAT_MBYTE if (has_mbyte) bd.textstart += (*mb_ptr2len)(bd.textstart); + else #endif ++bd.textstart; }
