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
This commit is contained in:
Florian Walch
2014-12-23 14:31:05 +01:00
parent 75b7b04436
commit 12245f9f1f
2 changed files with 7 additions and 1 deletions

View File

@@ -3583,6 +3583,12 @@ restore_backup:
&& (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL) && (overwriting || vim_strchr(p_cpo, CPO_PLUS) != NULL)
) { ) {
unchanged(buf, TRUE); 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_unchanged(buf);
u_update_save_nr(buf); u_update_save_nr(buf);
} }

View File

@@ -245,7 +245,7 @@ static int included_patches[] = {
//496 NA //496 NA
//495 NA //495 NA
494, 494,
//493, 493,
//492, //492,
//491, //491,
//490, //490,