mirror of
https://github.com/neovim/neovim.git
synced 2025-09-08 12:28:18 +00:00
vim-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 vim/vim#2742)
8c64a36e40
This commit is contained in:
@@ -296,6 +296,11 @@ open_buffer (
|
||||
}
|
||||
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 = buf_get_changedtick(curbuf);
|
||||
curbuf->b_last_changedtick_pum = buf_get_changedtick(curbuf);
|
||||
|
||||
/* require "!" to overwrite the file, because it wasn't read completely */
|
||||
if (aborting())
|
||||
curbuf->b_flags |= BF_READERR;
|
||||
|
Reference in New Issue
Block a user