mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 05:28:33 +00:00
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.
c024b46678
This commit is contained in:
@@ -478,9 +478,11 @@ changed_lines(
|
||||
}
|
||||
}
|
||||
|
||||
/// Called when the changed flag must be reset for buffer "buf".
|
||||
/// When "ff" is true also reset 'fileformat'.
|
||||
void unchanged(buf_T *buf, int ff)
|
||||
/// 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 even
|
||||
/// when the changed flag was off.
|
||||
void unchanged(buf_T *buf, int ff, bool always_inc_changedtick)
|
||||
{
|
||||
if (buf->b_changed || (ff && file_ff_differs(buf, false))) {
|
||||
buf->b_changed = false;
|
||||
@@ -491,8 +493,10 @@ void unchanged(buf_T *buf, int ff)
|
||||
check_status(buf);
|
||||
redraw_tabline = true;
|
||||
need_maketitle = true; // set window title later
|
||||
buf_inc_changedtick(buf);
|
||||
} else if (always_inc_changedtick) {
|
||||
buf_inc_changedtick(buf);
|
||||
}
|
||||
buf_inc_changedtick(buf);
|
||||
}
|
||||
|
||||
/// Insert string "p" at the cursor position. Stops at a NUL byte.
|
||||
|
Reference in New Issue
Block a user