vim-patch:8.1.1681: insert stray "{" when listener gets buffer line

Problem:    Insert stray "{" when listener gets buffer line. (Paul Jolly)
Solution:   Flush the cached line after invoking listeners. (closes vim/vim#4455)

0fb286e82d

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
Jan Edmund Lazo
2025-08-09 23:27:13 -04:00
parent 36fc266e86
commit 83f38800e7

View File

@@ -2040,6 +2040,9 @@ static int ml_append_int(buf_T *buf, linenr_T lnum, char *line, colnr_T len, boo
if (len == 0) {
len = (colnr_T)strlen(line) + 1; // space needed for the text
}
if (curbuf->b_ml.ml_line_lnum != 0) {
ml_flush_line(curbuf, false);
}
int space_needed = len + (int)INDEX_SIZE; // space needed for text + index
memfile_T *mfp = buf->b_ml.ml_mfp;