summaryrefslogtreecommitdiffstats
path: root/src/change.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-08 18:07:21 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-08 18:07:21 +0200
commitc024b4667875e5bc6fd0ed791530e33c3161bff7 (patch)
tree4b7c358c24cb5f5d6d36a40250afbd44eaf6dda7 /src/change.c
parentaef5c62a6fff7654bb8df7b9359e811f7a6e428f (diff)
patch 8.1.1498: ":write" increments b:changedtick even though nothing changedv8.1.1498
Problem: ":write" increments b:changedtick even though nothing changed. (Daniel Hahler) Solution: Only increment b:changedtick if the modified flag is reset.
Diffstat (limited to 'src/change.c')
-rw-r--r--src/change.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/change.c b/src/change.c
index fcaa5708a9..b928786eb0 100644
--- a/src/change.c
+++ b/src/change.c
@@ -842,9 +842,11 @@ changed_lines(
/*
* Called when the changed flag must be reset for buffer "buf".
* When "ff" is TRUE also reset 'fileformat'.
+ * When "always_inc_changedtick" is TRUE b:changedtick is incremented also when
+ * the changed flag was off.
*/
void
-unchanged(buf_T *buf, int ff)
+unchanged(buf_T *buf, int ff, int always_inc_changedtick)
{
if (buf->b_changed || (ff && file_ff_differs(buf, FALSE)))
{
@@ -857,8 +859,10 @@ unchanged(buf_T *buf, int ff)
#ifdef FEAT_TITLE
need_maketitle = TRUE; // set window title later
#endif
+ ++CHANGEDTICK(buf);
}
- ++CHANGEDTICK(buf);
+ else if (always_inc_changedtick)
+ ++CHANGEDTICK(buf);
#ifdef FEAT_NETBEANS_INTG
netbeans_unmodified(buf);
#endif