{
# ifdef FEAT_MBYTE
if (has_mbyte)
+ {
+ int len = (*mb_ptr2len)(ml_get_pos(pos));
+
/* we're counting bytes, not characters */
- todo -= (*mb_ptr2len)(ml_get_pos(pos)) - 1;
+ if (len > 0)
+ todo -= len - 1;
+ }
# endif
did_change |= swapchar(op_type, pos);
if (inc(pos) == -1) /* at end of file */
Tests for case-insensitive UTF-8 comparisons (utf_strnicmp() in mbyte.c)
+Also test "g~ap".
STARTTEST
:so small.vim
:for n in range(0x80, 0xBF) | call EQ(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor
:for n in range(0xC0, 0xFF) | call LT(printf('xYz\xc2\x%.2XUvW', n), printf('XyZ\xc2\x%.2XuVw', n)) | endfor
:call append(0, printf('%d checks passed', b:passed))
+:"
+:" test that g~ap changes one paragraph only.
+:new
+iabcd
+
+defg\egg0g~ap:let lns = getline(1,3)
+:q!
+:call append(line('$'), lns)
+:"
:wq! test.out
ENDTEST