diff options
author | Florian Walch <florian@fwalch.com> | 2014-12-23 14:31:05 +0100 |
---|---|---|
committer | Florian Walch <florian@fwalch.com> | 2014-12-23 21:17:00 +0100 |
commit | 12245f9f1fc6b7853b1d65012b50f99015769b84 (patch) | |
tree | 494a87f5670eed0edc078c098d3cef43d77c01dc | |
parent | 75b7b04436b6db0885c162bd7eefcadf7766905d (diff) | |
download | rneovim-12245f9f1fc6b7853b1d65012b50f99015769b84.tar.gz rneovim-12245f9f1fc6b7853b1d65012b50f99015769b84.tar.bz2 rneovim-12245f9f1fc6b7853b1d65012b50f99015769b84.zip |
vim-patch:7.4.493
Problem: A TextChanged autocommand is triggered when saving a file.
(William Gardner)
Solution: Update last_changedtick after calling unchanged(). (Christian
Brabandt)
https://code.google.com/p/vim/source/detail?r=v7-4-493
-rw-r--r-- | src/nvim/fileio.c | 6 | ||||
-rw-r--r-- | src/nvim/version.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 82613f5b07..58e67fa58c 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -3583,6 +3583,12 @@ restore_backup: && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL) ) { unchanged(buf, TRUE); + /* buf->b_changedtick is always incremented in unchanged() but that + * should not trigger a TextChanged event. */ + if (last_changedtick + 1 == buf->b_changedtick + && last_changedtick_buf == buf) { + last_changedtick = buf->b_changedtick; + } u_unchanged(buf); u_update_save_nr(buf); } diff --git a/src/nvim/version.c b/src/nvim/version.c index 08862de715..9a5d3fefe8 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -245,7 +245,7 @@ static int included_patches[] = { //496 NA //495 NA 494, - //493, + 493, //492, //491, //490, |