diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-09-16 21:55:43 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-09-16 21:55:43 +0000 |
commit | 60a795aad6ade281146a5343b416f21825af5364 (patch) | |
tree | f38bf3d5e39bd321b2ff7b4d9bdf0367c8bec00b /src/ops.c | |
parent | 6b730e111c329caccbb16f08c5b6bbc41d3b5690 (diff) | |
download | vim-git-60a795aad6ade281146a5343b416f21825af5364.tar.gz |
updated for version 7.0148v7.0148
Diffstat (limited to 'src/ops.c')
-rw-r--r-- | src/ops.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -2140,8 +2140,8 @@ op_tilde(oap) pos_T pos; #ifdef FEAT_VISUAL struct block_def bd; -#endif int todo; +#endif int did_change = 0; if (u_save((linenr_T)(oap->start.lnum - 1), @@ -2158,10 +2158,10 @@ op_tilde(oap) pos.col = bd.textcol; for (todo = bd.textlen; todo > 0; --todo) { -#ifdef FEAT_MBYTE +# ifdef FEAT_MBYTE if (has_mbyte) todo -= (*mb_ptr2len)(ml_get_pos(&pos)) - 1; -#endif +# endif did_change |= swapchar(oap->op_type, &pos); if (inc(&pos) == -1) /* at end of file */ break; @@ -2195,16 +2195,13 @@ op_tilde(oap) else if (!oap->inclusive) dec(&(oap->end)); - for (todo = oap->end.col - pos.col + 1; todo > 0; --todo) + while (ltoreq(pos, oap->end)) { -#ifdef FEAT_MBYTE - if (has_mbyte) - todo -= (*mb_ptr2len)(ml_get_pos(&pos)) - 1; -#endif did_change |= swapchar(oap->op_type, &pos); if (inc(&pos) == -1) /* at end of file */ break; } + if (did_change) { changed_lines(oap->start.lnum, oap->start.col, oap->end.lnum + 1, |