1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
|
To: vim_dev@googlegroups.com
Subject: Patch 7.3.111
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------
Patch 7.3.111 (after 7.3.100)
Problem: Executing a :normal command in 'statusline' evaluation causes the
cursor to move. (Dominique Pelle)
Solution: When updating the cursor for 'cursorbind' allow the cursor beyond
the end of the line. When evaluating 'statusline' temporarily
reset 'cursorbind'.
Files: src/move.c, src/screen.c
*** ../vim-7.3.110/src/move.c 2011-01-22 21:05:02.000000000 +0100
--- src/move.c 2011-02-01 17:36:10.000000000 +0100
***************
*** 2846,2851 ****
--- 2846,2852 ----
colnr_T col = curwin->w_cursor.col;
win_T *old_curwin = curwin;
buf_T *old_curbuf = curbuf;
+ int restart_edit_save;
# ifdef FEAT_VISUAL
int old_VIsual_select = VIsual_select;
int old_VIsual_active = VIsual_active;
***************
*** 2875,2882 ****
curwin->w_cursor.lnum = line;
curwin->w_cursor.col = col;
! /* Make sure the cursor is in a valid position. */
check_cursor();
# ifdef FEAT_MBYTE
/* Correct cursor for multi-byte character. */
if (has_mbyte)
--- 2876,2887 ----
curwin->w_cursor.lnum = line;
curwin->w_cursor.col = col;
! /* Make sure the cursor is in a valid position. Temporarily set
! * "restart_edit" to allow the cursor to be beyond the EOL. */
! restart_edit_save = restart_edit;
! restart_edit = TRUE;
check_cursor();
+ restart_edit = restart_edit_save;
# ifdef FEAT_MBYTE
/* Correct cursor for multi-byte character. */
if (has_mbyte)
*** ../vim-7.3.110/src/screen.c 2010-12-30 14:57:03.000000000 +0100
--- src/screen.c 2011-02-01 17:45:45.000000000 +0100
***************
*** 6435,6440 ****
--- 6435,6442 ----
struct stl_hlrec hltab[STL_MAX_ITEM];
struct stl_hlrec tabtab[STL_MAX_ITEM];
int use_sandbox = FALSE;
+ win_T *ewp;
+ int p_crb_save;
/* setup environment for the task at hand */
if (wp == NULL)
***************
*** 6513,6526 ****
if (maxwidth <= 0)
return;
/* Make a copy, because the statusline may include a function call that
* might change the option value and free the memory. */
stl = vim_strsave(stl);
! width = build_stl_str_hl(wp == NULL ? curwin : wp,
! buf, sizeof(buf),
stl, use_sandbox,
fillchar, maxwidth, hltab, tabtab);
vim_free(stl);
/* Make all characters printable. */
p = transstr(buf);
--- 6515,6534 ----
if (maxwidth <= 0)
return;
+ /* Temporarily reset 'cursorbind', we don't want a side effect from moving
+ * the cursor away and back. */
+ ewp = wp == NULL ? curwin : wp;
+ p_crb_save = ewp->w_p_crb;
+ ewp->w_p_crb = FALSE;
+
/* Make a copy, because the statusline may include a function call that
* might change the option value and free the memory. */
stl = vim_strsave(stl);
! width = build_stl_str_hl(ewp, buf, sizeof(buf),
stl, use_sandbox,
fillchar, maxwidth, hltab, tabtab);
vim_free(stl);
+ ewp->w_p_crb = p_crb_save;
/* Make all characters printable. */
p = transstr(buf);
*** ../vim-7.3.110/src/version.c 2011-02-01 17:12:20.000000000 +0100
--- src/version.c 2011-02-01 18:00:14.000000000 +0100
***************
*** 716,717 ****
--- 716,719 ----
{ /* Add new patch number below this line */
+ /**/
+ 111,
/**/
--
hundred-and-one symptoms of being an internet addict:
177. You log off of your system because it's time to go to work.
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|