Mercurial > vim
changeset 1099:2ec8266fa254 v7.0.225
updated for version 7.0-225
author | vimboss |
---|---|
date | Thu, 26 Apr 2007 08:54:21 +0000 |
parents | 5a1d8468d1fa |
children | f927ca2cedb4 |
files | src/eval.c src/misc2.c src/version.c |
diffstat | 3 files changed, 11 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -14397,7 +14397,8 @@ f_setline(argvars, rettv) if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK) { changed_bytes(lnum, 0); - check_cursor_col(); + if (lnum == curwin->w_cursor.lnum) + check_cursor_col(); rettv->vval.v_number = 0; /* OK */ } }
--- a/src/misc2.c +++ b/src/misc2.c @@ -516,7 +516,14 @@ check_cursor_col() || virtual_active()) curwin->w_cursor.col = len; else + { curwin->w_cursor.col = len - 1; +#ifdef FEAT_MBYTE + /* prevent cursor from moving on the trail byte */ + if (has_mbyte) + mb_adjust_cursor(); +#endif + } } #ifdef FEAT_VIRTUALEDIT