mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 9.1.0112: Remove undo information, when cleaning quickfix buffer
Problem: When the quickfix buffer has been modified an autocommand may invalidate the undo stack (kawarimidoll) Solution: When clearing the quickfix buffer, also wipe the undo stack fixes: #13905 closes: #13928 Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
@@ -4829,8 +4829,18 @@ qf_fill_buffer(qf_list_T *qfl, buf_T *buf, qfline_T *old_last, int qf_winid)
|
||||
}
|
||||
|
||||
// delete all existing lines
|
||||
//
|
||||
// Note: we cannot store undo information, because
|
||||
// qf buffer is usually not allowed to be modified.
|
||||
//
|
||||
// So we need to clean up undo information
|
||||
// otherwise autocommands may invalidate the undo stack
|
||||
while ((curbuf->b_ml.ml_flags & ML_EMPTY) == 0)
|
||||
(void)ml_delete((linenr_T)1);
|
||||
|
||||
// Remove all undo information
|
||||
u_blockfree(curbuf);
|
||||
u_clearall(curbuf);
|
||||
}
|
||||
|
||||
// Check if there is anything to display
|
||||
|
Reference in New Issue
Block a user