buffer updates: add on_reload callback and handle it in treesitter parser

This commit is contained in:
Björn Linse
2021-02-07 07:32:19 +01:00
parent fa5f583981
commit 94622ca66b
9 changed files with 146 additions and 62 deletions

View File

@@ -2537,13 +2537,13 @@ int do_ecmd(
goto theend;
}
u_unchanged(curbuf);
buf_updates_unregister_all(curbuf);
buf_updates_unload(curbuf, false);
buf_freeall(curbuf, BFA_KEEP_UNDO);
// Tell readfile() not to clear or reload undo info.
readfile_flags = READ_KEEP_UNDO;
} else {
buf_updates_unregister_all(curbuf);
buf_updates_unload(curbuf, false);
buf_freeall(curbuf, 0); // Free all things for buffer.
}
// If autocommands deleted the buffer we were going to re-edit, give