summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2011-02-01 18:01:11 +0100
committerBram Moolenaar <Bram@vim.org>2011-02-01 18:01:11 +0100
commit6145285c905ae9a65cf83473ad490e1b077a8c6f (patch)
tree192e1b3c2c7c382db3e374510c7056b3fcb16c6a
parentacf1728ef5ca881daaefd0819e66bd59efb35762 (diff)
updated for version 7.3.111v7.3.111
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'.
-rw-r--r--src/move.c7
-rw-r--r--src/screen.c12
-rw-r--r--src/version.c2
3 files changed, 18 insertions, 3 deletions
diff --git a/src/move.c b/src/move.c
index 447445b461..79df9285ad 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2846,6 +2846,7 @@ do_check_cursorbind()
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,8 +2876,12 @@ do_check_cursorbind()
curwin->w_cursor.lnum = line;
curwin->w_cursor.col = col;
- /* Make sure the cursor is in a valid position. */
+ /* 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)
diff --git a/src/screen.c b/src/screen.c
index 340dfd02fe..1726fac82a 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -6435,6 +6435,8 @@ win_redr_custom(wp, draw_ruler)
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,14 +6515,20 @@ win_redr_custom(wp, draw_ruler)
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(wp == NULL ? curwin : wp,
- buf, sizeof(buf),
+ 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);
diff --git a/src/version.c b/src/version.c
index d635dfee90..cc3174f312 100644
--- a/src/version.c
+++ b/src/version.c
@@ -715,6 +715,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 111,
+/**/
110,
/**/
109,