mirror of
https://github.com/vim/vim.git
synced 2025-09-23 03:43:49 -04:00
patch 8.0.1575: crash when using virtual replace
Problem: Crash when using virtual replace. Solution: Adjust orig_line_count. Add more tests. (Christian Brabandt)
This commit is contained in:
10
src/edit.c
10
src/edit.c
@@ -8907,7 +8907,17 @@ ins_del(void)
|
||||
|| do_join(2, FALSE, TRUE, FALSE, FALSE) == FAIL)
|
||||
vim_beep(BO_BS);
|
||||
else
|
||||
{
|
||||
curwin->w_cursor.col = temp;
|
||||
#ifdef FEAT_VREPLACE
|
||||
/* Adjust orig_line_count in case more lines have been deleted than
|
||||
* have been added. That makes sure, that open_line() later
|
||||
* can access all buffer lines correctly */
|
||||
if (State & VREPLACE_FLAG &&
|
||||
orig_line_count > curbuf->b_ml.ml_line_count)
|
||||
orig_line_count = curbuf->b_ml.ml_line_count;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (del_char(FALSE) == FAIL) /* delete char under cursor */
|
||||
vim_beep(BO_BS);
|
||||
|
Reference in New Issue
Block a user