diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-07 08:35:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-07 08:35:29 +0800 |
commit | 6b72ee1f15757907776ef7840d640906da02e924 (patch) | |
tree | 4cdd01299d8ee81a6e9afe62fbf7d2306ea4c1f3 /src | |
parent | 4cded8cec13cb91ce97d6c505879123b8b892bb3 (diff) | |
parent | 8ce60ddd079450e711e4620fdfa29deb372c0843 (diff) | |
download | rneovim-6b72ee1f15757907776ef7840d640906da02e924.tar.gz rneovim-6b72ee1f15757907776ef7840d640906da02e924.tar.bz2 rneovim-6b72ee1f15757907776ef7840d640906da02e924.zip |
Merge pull request #19263 from zeertzjq/vim-8.2.3674
vim-patch:8.2.{3674,4399}: problems after ml_get error
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/memline.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/nvim/memline.c b/src/nvim/memline.c index 1c54035a9e..5f74440747 100644 --- a/src/nvim/memline.c +++ b/src/nvim/memline.c @@ -1834,6 +1834,7 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change) DATA_BL *dp; char_u *ptr; static int recursive = 0; + static char_u questions[4]; if (lnum > buf->b_ml.ml_line_count) { // invalid line number if (recursive == 0) { @@ -1843,9 +1844,12 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change) siemsg(_("E315: ml_get: invalid lnum: %" PRId64), (int64_t)lnum); recursive--; } + ml_flush_line(buf); + buf->b_ml.ml_flags &= ~ML_LINE_DIRTY; errorret: - STRCPY(IObuff, "???"); - return IObuff; + STRCPY(questions, "???"); + buf->b_ml.ml_line_lnum = lnum; + return questions; } if (lnum <= 0) { // pretend line 0 is line 1 lnum = 1; |