# HG changeset patch # User vimboss # Date 1177577661 0 # Node ID 2ec8266fa254f9f90fd302df275d2813ae08a8e6 # Parent 5a1d8468d1fad7189c8c781149f034dbb4208b39 updated for version 7.0-225 diff --git a/src/eval.c b/src/eval.c --- 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 */ } } diff --git a/src/misc2.c b/src/misc2.c --- 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 diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -667,6 +667,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 225, +/**/ 224, /**/ 223,