Mercurial > vim
diff src/edit.c @ 13402:338b15c63e2c v8.0.1575
patch 8.0.1575: crash when using virtual replace
commit https://github.com/vim/vim/commit/63e82db6fc910b2d8f1cd018894e50e8b4448155
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Mar 6 12:10:48 2018 +0100
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 06 Mar 2018 12:15:05 +0100 |
parents | 6740c499de13 |
children | 66b1d74be322 |
line wrap: on
line diff
--- a/src/edit.c +++ b/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);