]>
Commit | Line | Data |
---|---|---|
21b7d176 ER |
1 | To: vim_dev@googlegroups.com |
2 | Subject: Patch 7.3.111 | |
3 | Fcc: outbox | |
4 | From: Bram Moolenaar <Bram@moolenaar.net> | |
5 | Mime-Version: 1.0 | |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ------------ | |
9 | ||
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 | |
15 | reset 'cursorbind'. | |
16 | Files: src/move.c, src/screen.c | |
17 | ||
18 | ||
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 | |
21 | *************** | |
22 | *** 2846,2851 **** | |
23 | --- 2846,2852 ---- | |
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; | |
28 | # ifdef FEAT_VISUAL | |
29 | int old_VIsual_select = VIsual_select; | |
30 | int old_VIsual_active = VIsual_active; | |
31 | *************** | |
32 | *** 2875,2882 **** | |
33 | curwin->w_cursor.lnum = line; | |
34 | curwin->w_cursor.col = col; | |
35 | ||
36 | ! /* Make sure the cursor is in a valid position. */ | |
37 | check_cursor(); | |
38 | # ifdef FEAT_MBYTE | |
39 | /* Correct cursor for multi-byte character. */ | |
40 | if (has_mbyte) | |
41 | --- 2876,2887 ---- | |
42 | curwin->w_cursor.lnum = line; | |
43 | curwin->w_cursor.col = col; | |
44 | ||
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; | |
49 | check_cursor(); | |
50 | + restart_edit = restart_edit_save; | |
51 | # ifdef FEAT_MBYTE | |
52 | /* Correct cursor for multi-byte character. */ | |
53 | if (has_mbyte) | |
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 | |
56 | *************** | |
57 | *** 6435,6440 **** | |
58 | --- 6435,6442 ---- | |
59 | struct stl_hlrec hltab[STL_MAX_ITEM]; | |
60 | struct stl_hlrec tabtab[STL_MAX_ITEM]; | |
61 | int use_sandbox = FALSE; | |
62 | + win_T *ewp; | |
63 | + int p_crb_save; | |
64 | ||
65 | /* setup environment for the task at hand */ | |
66 | if (wp == NULL) | |
67 | *************** | |
68 | *** 6513,6526 **** | |
69 | if (maxwidth <= 0) | |
70 | return; | |
71 | ||
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, | |
76 | ! buf, sizeof(buf), | |
77 | stl, use_sandbox, | |
78 | fillchar, maxwidth, hltab, tabtab); | |
79 | vim_free(stl); | |
80 | ||
81 | /* Make all characters printable. */ | |
82 | p = transstr(buf); | |
83 | --- 6515,6534 ---- | |
84 | if (maxwidth <= 0) | |
85 | return; | |
86 | ||
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; | |
92 | + | |
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), | |
97 | stl, use_sandbox, | |
98 | fillchar, maxwidth, hltab, tabtab); | |
99 | vim_free(stl); | |
100 | + ewp->w_p_crb = p_crb_save; | |
101 | ||
102 | /* Make all characters printable. */ | |
103 | p = transstr(buf); | |
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 | |
106 | *************** | |
107 | *** 716,717 **** | |
108 | --- 716,719 ---- | |
109 | { /* Add new patch number below this line */ | |
110 | + /**/ | |
111 | + 111, | |
112 | /**/ | |
113 | ||
114 | -- | |
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. | |
117 | ||
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 /// |