mirror of
https://github.com/neovim/neovim.git
synced 2025-09-09 04:48:18 +00:00
mark: Clear marks in some cases, but do not do useless job in free_\*
This commit is contained in:
@@ -557,9 +557,9 @@ static void free_buffer(buf_T *buf)
|
||||
unref_var_dict(buf->b_vars);
|
||||
aubuflocal_remove(buf);
|
||||
dict_unref(buf->additional_data);
|
||||
free_fmark(buf->b_last_cursor);
|
||||
free_fmark(buf->b_last_insert);
|
||||
free_fmark(buf->b_last_change);
|
||||
clear_fmark(&buf->b_last_cursor);
|
||||
clear_fmark(&buf->b_last_insert);
|
||||
clear_fmark(&buf->b_last_change);
|
||||
for (size_t i = 0; i < NMARKS; i++) {
|
||||
free_fmark(buf->b_namedm[i]);
|
||||
}
|
||||
@@ -569,6 +569,8 @@ static void free_buffer(buf_T *buf)
|
||||
if (autocmd_busy) {
|
||||
// Do not free the buffer structure while autocommands are executing,
|
||||
// it's still needed. Free it when autocmd_busy is reset.
|
||||
memset(&buf->b_namedm[0], 0, sizeof(buf->b_namedm));
|
||||
memset(&buf->b_changelist[0], 0, sizeof(buf->b_changelist));
|
||||
buf->b_next = au_pending_free_buf;
|
||||
au_pending_free_buf = buf;
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user