]> granicus.if.org Git - vim/commitdiff
patch 8.0.0735: no indication that the quickfix window/buffer changed v8.0.0735
authorBram Moolenaar <Bram@vim.org>
Wed, 19 Jul 2017 15:06:20 +0000 (17:06 +0200)
committerBram Moolenaar <Bram@vim.org>
Wed, 19 Jul 2017 15:06:20 +0000 (17:06 +0200)
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)

runtime/doc/quickfix.txt
src/quickfix.c
src/testdir/test_quickfix.vim
src/version.c

index 0ca52aa06311a3e891855c2051c3108b816056b5..e555451b506ec4c2567aa069b166de3e61ec4c51 100644 (file)
@@ -425,7 +425,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
index bc891bfde27850549ac6bf0747526017a592dad4..2adfc52adf051860e1f23cff286fec0c894634d4 100644 (file)
@@ -3286,6 +3286,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
        qf_update_win_titlevar(qi);
 
        qf_fill_buffer(qi, buf, old_last);
+       ++CHANGEDTICK(buf);
 
        if (old_last == NULL)
        {
index b3cc6891a53216fc1ecfa6240742417ea32abef7..7b344eaad74460816637be7cd3b6f343b0a28450 100644 (file)
@@ -2263,3 +2263,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
index 08d365645e5222bc4d764a0f7cba659fe92b3b2c..5373e706e4fab64395ca6273c129f8743962e7f3 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    735,
 /**/
     734,
 /**/