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.
int lnum = curwin->w_cursor.lnum;
int lnume = curwin->w_cursor.lnum;
int startcol;
+ int did_change = FALSE;
dohex = (vim_strchr(curbuf->b_p_nf, 'x') != NULL); /* "heX" */
dooct = (vim_strchr(curbuf->b_p_nf, 'o') != NULL); /* "Octal" */
#endif
}
curwin->w_cursor.col = col;
+ did_change = TRUE;
(void)del_char(FALSE);
ins_char(firstdigit);
}
* Delete the old number.
*/
curwin->w_cursor.col = col;
+ did_change = TRUE;
todel = length;
c = gchar_cursor();
RLADDSUBFIX(ptr);
#endif
}
- --curwin->w_cursor.col;
+ if (did_change && curwin->w_cursor.col > 0)
+ --curwin->w_cursor.col;
return OK;
}
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 779,
/**/
778,
/**/