From 83c5701fe6d182c2f458b95d09114d9c861f8893 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sat, 31 Aug 2019 14:06:45 +0200 Subject: vim-patch:8.1.1498: ":write" increments b:changedtick even though nothing changed Problem: ":write" increments b:changedtick even though nothing changed. (Daniel Hahler) Solution: Only increment b:changedtick if the modified flag is reset. https://github.com/vim/vim/commit/c024b4667875e5bc6fd0ed791530e33c3161bff7 --- runtime/doc/eval.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt index 06f88955c9..8ec9dbdbdf 100644 --- a/runtime/doc/eval.txt +++ b/runtime/doc/eval.txt @@ -1313,8 +1313,10 @@ One local buffer variable is predefined: *b:changedtick* *changetick* b:changedtick The total number of changes to the current buffer. It is incremented for each change. An undo command is also a change - in this case. This can be used to perform an action only when - the buffer has changed. Example: > + in this case. Resetting 'modified' when writing the buffer is + also counted. + This can be used to perform an action only when the buffer has + changed. Example: > :if my_changedtick != b:changedtick : let my_changedtick = b:changedtick : call My_Update() -- cgit