diff options
author | Bram Moolenaar <Bram@vim.org> | 2008-01-02 16:49:36 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2008-01-02 16:49:36 +0000 |
commit | 2c994e8516496ce153527694a35a3017ff174baa (patch) | |
tree | abc79935e33bb7b4d5862d51b8911da181f543eb /src/misc1.c | |
parent | ad8958b1889835804c7bccb87603634bd87ac5df (diff) | |
download | vim-git-2c994e8516496ce153527694a35a3017ff174baa.tar.gz |
updated for version 7.1-185v7.1.185
Diffstat (limited to 'src/misc1.c')
-rw-r--r-- | src/misc1.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/misc1.c b/src/misc1.c index b67405fb4..99c90f76b 100644 --- a/src/misc1.c +++ b/src/misc1.c @@ -591,7 +591,14 @@ open_line(dir, flags, old_indent) replace_push(NUL); p = saved_line + curwin->w_cursor.col; while (*p != NUL) - replace_push(*p++); + { +#ifdef FEAT_MBYTE + if (has_mbyte) + p += replace_push_mb(p); + else +#endif + replace_push(*p++); + } saved_line[curwin->w_cursor.col] = NUL; } #endif @@ -1914,7 +1921,6 @@ ins_char_bytes(buf, charlen) int charlen; { int c = buf[0]; - int l, j; #endif int newlen; /* nr of bytes inserted */ int oldlen; /* nr of bytes deleted (0 when not replacing) */ @@ -2016,13 +2022,11 @@ ins_char_bytes(buf, charlen) for (i = 0; i < oldlen; ++i) { #ifdef FEAT_MBYTE - l = (*mb_ptr2len)(oldp + col + i) - 1; - for (j = l; j >= 0; --j) - replace_push(oldp[col + i + j]); - i += l; -#else - replace_push(oldp[col + i]); + if (has_mbyte) + i += replace_push_mb(oldp + col + i) - 1; + else #endif + replace_push(oldp[col + i]); } } |