0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 8.1.0425: ml_get error and crash with appendbufline()

Problem:    ml_get error and crash with appendbufline(). (Masashi Iizuka)
Solution:   Set per-window buffer info. (Hirohito Higashi, closes #3455)
This commit is contained in:
Bram Moolenaar
2018-09-21 16:59:45 +02:00
parent e76d7a63df
commit 9cea87c577
3 changed files with 35 additions and 0 deletions

View File

@@ -428,7 +428,10 @@ can_unload_buffer(buf_T *buf)
FOR_ALL_WINDOWS(wp)
if (wp->w_buffer == buf)
{
can_unload = FALSE;
break;
}
}
if (!can_unload)
EMSG(_("E937: Attempt to delete a buffer that is in use"));
@@ -1742,6 +1745,9 @@ enter_buffer(buf_T *buf)
/* mark cursor position as being invalid */
curwin->w_valid = 0;
buflist_setfpos(curbuf, curwin, curbuf->b_last_cursor.lnum,
curbuf->b_last_cursor.col, TRUE);
/* Make sure the buffer is loaded. */
if (curbuf->b_ml.ml_mfp == NULL) /* need to load the file */
{