4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=ISO-8859-1
7 Content-Transfer-Encoding: 8bit
11 Problem: When using setline() in an InsertEnter autocommand and doing "A"
12 the cursor ends up on the last byte in the line. (Yukihiro
14 Solution: Only adjust the column when using setline() for the cursor line.
15 Move it back to the head byte if necessary.
16 Files: src/eval.c, src/misc2.c
19 *** ../vim-7.0.224/src/eval.c Tue Mar 27 16:57:54 2007
20 --- src/eval.c Thu Apr 26 10:52:09 2007
23 if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK)
25 changed_bytes(lnum, 0);
27 rettv->vval.v_number = 0; /* OK */
31 if (u_savesub(lnum) == OK && ml_replace(lnum, line, TRUE) == OK)
33 changed_bytes(lnum, 0);
34 ! if (lnum == curwin->w_cursor.lnum)
36 rettv->vval.v_number = 0; /* OK */
39 *** ../vim-7.0.224/src/misc2.c Tue Feb 20 03:18:20 2007
40 --- src/misc2.c Tue Mar 27 21:59:56 2007
45 curwin->w_cursor.col = len;
48 curwin->w_cursor.col = len - 1;
50 + /* prevent cursor from moving on the trail byte */
57 #ifdef FEAT_VIRTUALEDIT
58 *** ../vim-7.0.224/src/version.c Tue Mar 27 16:57:54 2007
59 --- src/version.c Thu Apr 26 10:53:33 2007
63 { /* Add new patch number below this line */
69 hundred-and-one symptoms of being an internet addict:
70 14. You start introducing yourself as "Jim at I-I-Net dot net dot au"
72 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
73 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
74 \\\ download, build and distribute -- http://www.A-A-P.org ///
75 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///