diff options
author | Bram Moolenaar <Bram@vim.org> | 2013-08-09 19:48:40 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2013-08-09 19:48:40 +0200 |
commit | f17968b54a00380d8e955bc13eb0a2ffd30ff8ea (patch) | |
tree | 96ff9e67c915542a00538c4d10c938a30eeebc38 /src/ops.c | |
parent | 86f931e1c3252798dbd60a5d4e07e3c64ae8ee74 (diff) | |
download | vim-git-7.4b.020.tar.gz |
updated for version 7.4b.020v7.4b.020
Problem: "g~ap" changes first character of next paragraph. (Manuel Ortega)
Solution: Avoid subtracting (0 - 1) from todo. (Mike Williams)
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -2429,8 +2429,13 @@ swapchars(op_type, pos, length) { # 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 */ |