mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 10:56:31 +00:00
vim-patch:8.2.4399: crash after ml_get error
Problem: Crash after ml_get error.
Solution: When returning "???" flush the line and set ml_line_lnum.
f9435e49ef
This commit is contained in:
@@ -1844,8 +1844,11 @@ char_u *ml_get_buf(buf_T *buf, linenr_T lnum, bool will_change)
|
|||||||
siemsg(_("E315: ml_get: invalid lnum: %" PRId64), (int64_t)lnum);
|
siemsg(_("E315: ml_get: invalid lnum: %" PRId64), (int64_t)lnum);
|
||||||
recursive--;
|
recursive--;
|
||||||
}
|
}
|
||||||
|
ml_flush_line(buf);
|
||||||
|
buf->b_ml.ml_flags &= ~ML_LINE_DIRTY;
|
||||||
errorret:
|
errorret:
|
||||||
STRCPY(questions, "???");
|
STRCPY(questions, "???");
|
||||||
|
buf->b_ml.ml_line_lnum = lnum;
|
||||||
return questions;
|
return questions;
|
||||||
}
|
}
|
||||||
if (lnum <= 0) { // pretend line 0 is line 1
|
if (lnum <= 0) { // pretend line 0 is line 1
|
||||||
|
Reference in New Issue
Block a user