Mercurial > vim
changeset 11705:c43118ecb0a3 v8.0.0735
patch 8.0.0735: no indication that the quickfix window/buffer changed
commit https://github.com/vim/vim/commit/a8788f4d0b991f466b607c2c5bc6fd600bc78a97
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Jul 19 17:06:20 2017 +0200
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)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 19 Jul 2017 17:15:04 +0200 |
parents | 8f67bf01e910 |
children | f4e65317cf67 |
files | runtime/doc/quickfix.txt src/quickfix.c src/testdir/test_quickfix.vim src/version.c |
diffstat | 4 files changed, 30 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/runtime/doc/quickfix.txt +++ b/runtime/doc/quickfix.txt @@ -425,7 +425,9 @@ 2. The error window *quickfix-window 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
--- a/src/quickfix.c +++ b/src/quickfix.c @@ -3286,6 +3286,7 @@ qf_update_buffer(qf_info_T *qi, qfline_T qf_update_win_titlevar(qi); qf_fill_buffer(qi, buf, old_last); + ++CHANGEDTICK(buf); if (old_last == NULL) {
--- a/src/testdir/test_quickfix.vim +++ b/src/testdir/test_quickfix.vim @@ -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