mirror of
https://github.com/vim/vim.git
synced 2025-09-30 04:44:14 -04:00
patch 7.4.779
Problem: Using CTRL-A in a line without a number moves the cursor. May cause a crash when at the start of the line. (Urtica Dioica) Solution: Do not move the cursor if no number was changed.
This commit is contained in:
@@ -5404,6 +5404,7 @@ do_addsub(command, Prenum1, g_cmd)
|
|||||||
int lnum = curwin->w_cursor.lnum;
|
int lnum = curwin->w_cursor.lnum;
|
||||||
int lnume = curwin->w_cursor.lnum;
|
int lnume = curwin->w_cursor.lnum;
|
||||||
int startcol;
|
int startcol;
|
||||||
|
int did_change = FALSE;
|
||||||
|
|
||||||
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
|
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
|
||||||
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
|
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
|
||||||
@@ -5547,6 +5548,7 @@ do_addsub(command, Prenum1, g_cmd)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
curwin->w_cursor.col = col;
|
curwin->w_cursor.col = col;
|
||||||
|
did_change = TRUE;
|
||||||
(void)del_char(FALSE);
|
(void)del_char(FALSE);
|
||||||
ins_char(firstdigit);
|
ins_char(firstdigit);
|
||||||
}
|
}
|
||||||
@@ -5619,6 +5621,7 @@ do_addsub(command, Prenum1, g_cmd)
|
|||||||
* Delete the old number.
|
* Delete the old number.
|
||||||
*/
|
*/
|
||||||
curwin->w_cursor.col = col;
|
curwin->w_cursor.col = col;
|
||||||
|
did_change = TRUE;
|
||||||
todel = length;
|
todel = length;
|
||||||
c = gchar_cursor();
|
c = gchar_cursor();
|
||||||
|
|
||||||
@@ -5713,6 +5716,7 @@ do_addsub(command, Prenum1, g_cmd)
|
|||||||
RLADDSUBFIX(ptr);
|
RLADDSUBFIX(ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
if (did_change && curwin->w_cursor.col > 0)
|
||||||
--curwin->w_cursor.col;
|
--curwin->w_cursor.col;
|
||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
@@ -741,6 +741,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
779,
|
||||||
/**/
|
/**/
|
||||||
778,
|
778,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user