mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
extmark: don't crash in RO buffer.
This commit is contained in:
@@ -243,7 +243,7 @@ int u_save(linenr_T top, linenr_T bot)
|
||||
*/
|
||||
int u_savesub(linenr_T lnum)
|
||||
{
|
||||
return u_savecommon(lnum - 1, lnum + 1, lnum + 1, FALSE);
|
||||
return u_savecommon(lnum - 1, lnum + 1, lnum + 1, false);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -254,7 +254,7 @@ int u_savesub(linenr_T lnum)
|
||||
*/
|
||||
int u_inssub(linenr_T lnum)
|
||||
{
|
||||
return u_savecommon(lnum - 1, lnum, lnum + 1, FALSE);
|
||||
return u_savecommon(lnum - 1, lnum, lnum + 1, false);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -3043,8 +3043,14 @@ u_header_T *u_force_get_undo_header(buf_T *buf)
|
||||
}
|
||||
// Create the first undo header for the buffer
|
||||
if (!uhp) {
|
||||
// TODO(timeyyy): there would be a better way to do this!
|
||||
u_save_cursor();
|
||||
// Undo is normally invoked in change code, which already has swapped
|
||||
// curbuf.
|
||||
buf_T *save_curbuf = curbuf;
|
||||
curbuf = buf;
|
||||
// Args are tricky: this means replace empty range by empty range..
|
||||
u_savecommon(0, 1, 1, true);
|
||||
curbuf = save_curbuf;
|
||||
|
||||
uhp = buf->b_u_curhead;
|
||||
if (!uhp) {
|
||||
uhp = buf->b_u_newhead;
|
||||
|
Reference in New Issue
Block a user