0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.0.1633: a TextChanged autocmd triggers when it is defined

Problem:    A TextChanged autocmd triggers when it is defined after creating a
            buffer.
Solution:   Set b_last_changedtick when opening a buffer. (Hirohito Highlight,
            closes #2742)
This commit is contained in:
Bram Moolenaar
2018-03-23 22:39:31 +01:00
parent 47015b80a0
commit 8c64a36e40
3 changed files with 30 additions and 0 deletions

View File

@@ -291,6 +291,13 @@ open_buffer(
unchanged(curbuf, FALSE);
save_file_ff(curbuf); /* keep this fileformat */
/* Set last_changedtick to avoid triggering a TextChanged autocommand right
* after it was added. */
curbuf->b_last_changedtick = CHANGEDTICK(curbuf);
#ifdef FEAT_INS_EXPAND
curbuf->b_last_changedtick_pum = CHANGEDTICK(curbuf);
#endif
/* require "!" to overwrite the file, because it wasn't read completely */
#ifdef FEAT_EVAL
if (aborting())