1
0
forked from aniani/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)
This commit is contained in:
Bram Moolenaar
2017-07-19 17:06:20 +02:00
parent bf92e3a371
commit a8788f4d0b
4 changed files with 30 additions and 1 deletions

View 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 which will indicate the command that produced the
quickfix list. This can be used to compose a custom quickfix list. This can be used to compose a custom
status line if the value of 'statusline' is adjusted 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* *:lopen*
:lop[en] [height] Open a window to show the location list for the :lop[en] [height] Open a window to show the location list for the

View File

@@ -3286,6 +3286,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T *old_last)
qf_update_win_titlevar(qi); qf_update_win_titlevar(qi);
qf_fill_buffer(qi, buf, old_last); qf_fill_buffer(qi, buf, old_last);
++CHANGEDTICK(buf);
if (old_last == NULL) if (old_last == NULL)
{ {

View File

@@ -2263,3 +2263,27 @@ func Test_resize_from_copen()
augroup! QF_Test augroup! QF_Test
endtry endtry
endfunc 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

View File

@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
735,
/**/ /**/
734, 734,
/**/ /**/