aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-28 23:53:41 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-07-28 23:58:34 -0400
commiteaa2cd9f7c65a684267318a7cc46db64e3431dbb (patch)
tree680349c863ae79241d664e92d99655ee4e3a1d30 /src
parent91b8210779c11d5ff6c37929f67d76fd738987b5 (diff)
downloadrneovim-eaa2cd9f7c65a684267318a7cc46db64e3431dbb.tar.gz
rneovim-eaa2cd9f7c65a684267318a7cc46db64e3431dbb.tar.bz2
rneovim-eaa2cd9f7c65a684267318a7cc46db64e3431dbb.zip
vim-patch:8.0.0735: no indication that the quickfix window/buffer changed
Problem: There is no way to notice that the quickfix window contents has changed. Solution: Increment b:changedtick when updating the quickfix window. (Yegappan Lakshmanan) https://github.com/vim/vim/commit/a8788f4d0b991f466b607c2c5bc6fd600bc78a97
Diffstat (limited to 'src')
-rw-r--r--src/nvim/quickfix.c1
-rw-r--r--src/nvim/testdir/test_quickfix.vim24
2 files changed, 25 insertions, 0 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 73cb79ef8a..4308c4e87e 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -2887,6 +2887,7 @@ static void qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
qf_update_win_titlevar(qi);
qf_fill_buffer(qi, buf, old_last);
+ buf_inc_changedtick(buf);
if (old_last == NULL) {
(void)qf_win_pos_update(qi, 0);
diff --git a/src/nvim/testdir/test_quickfix.vim b/src/nvim/testdir/test_quickfix.vim
index db907f129f..33abb69ca6 100644
--- a/src/nvim/testdir/test_quickfix.vim
+++ b/src/nvim/testdir/test_quickfix.vim
@@ -2245,3 +2245,27 @@ func Test_resize_from_copen()
augroup! QF_Test
endtry
endfunc
+
+" Tests for the quickfix buffer b:changedtick variable
+func Xchangedtick_tests(cchar)
+ call s:setup_commands(a:cchar)
+
+ new | only
+
+ Xexpr "" | Xexpr "" | Xexpr ""
+
+ Xopen
+ Xolder
+ Xolder
+ Xaddexpr "F1:10:Line10"
+ Xaddexpr "F2:20:Line20"
+ call g:Xsetlist([{"filename":"F3", "lnum":30, "text":"Line30"}], 'a')
+ call g:Xsetlist([], 'f')
+ call assert_equal(8, getbufvar('%', 'changedtick'))
+ Xclose
+endfunc
+
+func Test_changedtick()
+ call Xchangedtick_tests('c')
+ call Xchangedtick_tests('l')
+endfunc