diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-08-31 14:06:45 +0200 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2019-09-04 21:21:28 +0200 |
commit | 83c5701fe6d182c2f458b95d09114d9c861f8893 (patch) | |
tree | 76b83432a84a3f603bb35bd0452c73d12d4d6020 /src/nvim/buffer.c | |
parent | d7aea13fee879a5e7854f2ebe9b7321cd8daf84f (diff) | |
download | rneovim-83c5701fe6d182c2f458b95d09114d9c861f8893.tar.gz rneovim-83c5701fe6d182c2f458b95d09114d9c861f8893.tar.bz2 rneovim-83c5701fe6d182c2f458b95d09114d9c861f8893.zip |
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
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 382b4c45c1..6cb1da04be 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -144,7 +144,7 @@ read_buffer( if (!readonlymode && !BUFEMPTY()) { changed(); } else if (retval != FAIL) { - unchanged(curbuf, false); + unchanged(curbuf, false, true); } apply_autocmds_retval(EVENT_STDINREADPOST, NULL, NULL, false, @@ -299,7 +299,7 @@ int open_buffer( || (aborting() && vim_strchr(p_cpo, CPO_INTMOD) != NULL)) { changed(); } else if (retval != FAIL && !read_stdin && !read_fifo) { - unchanged(curbuf, false); + unchanged(curbuf, false, true); } save_file_ff(curbuf); // keep this fileformat @@ -641,13 +641,11 @@ void close_buffer(win_T *win, buf_T *buf, int action, int abort_if_last) } } -/* - * Make buffer not contain a file. - */ +/// Make buffer not contain a file. void buf_clear_file(buf_T *buf) { buf->b_ml.ml_line_count = 1; - unchanged(buf, true); + unchanged(buf, true, true); buf->b_p_eol = true; buf->b_start_eol = true; buf->b_p_bomb = false; |