diff options
-rw-r--r-- | runtime/doc/quickfix.txt | 4 | ||||
-rw-r--r-- | src/nvim/quickfix.c | 1 | ||||
-rw-r--r-- | src/nvim/testdir/test_quickfix.vim | 24 |
3 files changed, 28 insertions, 1 deletions
diff --git a/runtime/doc/quickfix.txt b/runtime/doc/quickfix.txt index f280286290..6939dd6836 100644 --- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -423,7 +423,9 @@ EXECUTE A COMMAND IN ALL THE BUFFERS IN QUICKFIX OR LOCATION LIST: which will indicate the command that produced the quickfix list. This can be used to compose a custom status line if the value of 'statusline' is adjusted - properly. + properly. Whenever this buffer is modified by a + quickfix command or function, the |b:changedtick| + variable is incremented. *:lop* *:lopen* :lop[en] [height] Open a window to show the location list for the 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 |