1 To: vim_dev@googlegroups.com
4 From: Bram Moolenaar <Bram@moolenaar.net>
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
10 Patch 7.3.111 (after 7.3.100)
11 Problem: Executing a :normal command in 'statusline' evaluation causes the
12 cursor to move. (Dominique Pelle)
13 Solution: When updating the cursor for 'cursorbind' allow the cursor beyond
14 the end of the line. When evaluating 'statusline' temporarily
16 Files: src/move.c, src/screen.c
19 *** ../vim-7.3.110/src/move.c 2011-01-22 21:05:02.000000000 +0100
20 --- src/move.c 2011-02-01 17:36:10.000000000 +0100
24 colnr_T col = curwin->w_cursor.col;
25 win_T *old_curwin = curwin;
26 buf_T *old_curbuf = curbuf;
27 + int restart_edit_save;
29 int old_VIsual_select = VIsual_select;
30 int old_VIsual_active = VIsual_active;
33 curwin->w_cursor.lnum = line;
34 curwin->w_cursor.col = col;
36 ! /* Make sure the cursor is in a valid position. */
39 /* Correct cursor for multi-byte character. */
42 curwin->w_cursor.lnum = line;
43 curwin->w_cursor.col = col;
45 ! /* Make sure the cursor is in a valid position. Temporarily set
46 ! * "restart_edit" to allow the cursor to be beyond the EOL. */
47 ! restart_edit_save = restart_edit;
48 ! restart_edit = TRUE;
50 + restart_edit = restart_edit_save;
52 /* Correct cursor for multi-byte character. */
54 *** ../vim-7.3.110/src/screen.c 2010-12-30 14:57:03.000000000 +0100
55 --- src/screen.c 2011-02-01 17:45:45.000000000 +0100
59 struct stl_hlrec hltab[STL_MAX_ITEM];
60 struct stl_hlrec tabtab[STL_MAX_ITEM];
61 int use_sandbox = FALSE;
65 /* setup environment for the task at hand */
72 /* Make a copy, because the statusline may include a function call that
73 * might change the option value and free the memory. */
74 stl = vim_strsave(stl);
75 ! width = build_stl_str_hl(wp == NULL ? curwin : wp,
78 fillchar, maxwidth, hltab, tabtab);
81 /* Make all characters printable. */
87 + /* Temporarily reset 'cursorbind', we don't want a side effect from moving
88 + * the cursor away and back. */
89 + ewp = wp == NULL ? curwin : wp;
90 + p_crb_save = ewp->w_p_crb;
91 + ewp->w_p_crb = FALSE;
93 /* Make a copy, because the statusline may include a function call that
94 * might change the option value and free the memory. */
95 stl = vim_strsave(stl);
96 ! width = build_stl_str_hl(ewp, buf, sizeof(buf),
98 fillchar, maxwidth, hltab, tabtab);
100 + ewp->w_p_crb = p_crb_save;
102 /* Make all characters printable. */
104 *** ../vim-7.3.110/src/version.c 2011-02-01 17:12:20.000000000 +0100
105 --- src/version.c 2011-02-01 18:00:14.000000000 +0100
109 { /* Add new patch number below this line */
115 hundred-and-one symptoms of being an internet addict:
116 177. You log off of your system because it's time to go to work.
118 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
119 /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
120 \\\ an exciting new programming language -- http://www.Zimbu.org ///
121 \\\ help me help AIDS victims -- http://ICCF-Holland.org ///