0
0
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:
Bram Moolenaar
2018-03-06 12:10:48 +01:00
parent 987723e084
commit 63e82db6fc
3 changed files with 69 additions and 2 deletions

View File

@@ -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);