Patch 8.2.2069
Problem: The quickfix window is not updated after setqflist().
Solution: Update the quickfix buffer. (Yegappan Lakshmanan, closes #7390,
closes #7385)
Files: src/quickfix.c, src/testdir/test_quickfix.vim
*** ../vim-8.2.2068/src/quickfix.c 2020-11-23 20:14:47.773734727 +0100
--- src/quickfix.c 2020-11-29 14:15:17.918406011 +0100
***************
*** 7349,7355 ****
if (action == 'r')
qf_free_items(&qi->qf_lists[qf_idx]);
if (qf_init_ext(qi, qf_idx, NULL, NULL, &di->di_tv, errorformat,
! FALSE, (linenr_T)0, (linenr_T)0, NULL, NULL) > 0)
retval = OK;
return retval;
--- 7349,7355 ----
if (action == 'r')
qf_free_items(&qi->qf_lists[qf_idx]);
if (qf_init_ext(qi, qf_idx, NULL, NULL, &di->di_tv, errorformat,
! FALSE, (linenr_T)0, (linenr_T)0, NULL, NULL) >= 0)
retval = OK;
return retval;
***************
*** 7474,7481 ****
if ((di = dict_find(what, (char_u *)"quickfixtextfunc", -1)) != NULL)
retval = qf_setprop_qftf(qi, qfl, di);
! if (retval == OK)
qf_list_changed(qfl);
return retval;
}
--- 7474,7483 ----
if ((di = dict_find(what, (char_u *)"quickfixtextfunc", -1)) != NULL)
retval = qf_setprop_qftf(qi, qfl, di);
! if (newlist || retval == OK)
qf_list_changed(qfl);
+ if (newlist)
+ qf_update_buffer(qi, NULL);
return retval;
}
*** ../vim-8.2.2068/src/testdir/test_quickfix.vim 2020-11-23
20:14:47.773734727 +0100
--- src/testdir/test_quickfix.vim 2020-11-29 14:15:17.918406011 +0100
***************
*** 5253,5256 ****
--- 5253,5314 ----
call delete('XquickfixFails')
endfunc
+ " Test for updating the quickfix buffer whenever the assocaited quickfix list
+ " is changed.
+ func Xqfbuf_update(cchar)
+ call s:setup_commands(a:cchar)
+
+ Xexpr "F1:1:line1"
+ Xopen
+ call assert_equal(['F1|1| line1'], getline(1, '$'))
+ call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
+
+ " Test setqflist() using the 'lines' key in 'what'
+ " add a new entry
+ call g:Xsetlist([], 'a', {'lines' : ['F2:2: line2']})
+ call assert_equal(['F1|1| line1', 'F2|2| line2'], getline(1, '$'))
+ call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " replace all the entries with a single entry
+ call g:Xsetlist([], 'r', {'lines' : ['F3:3: line3']})
+ call assert_equal(['F3|3| line3'], getline(1, '$'))
+ call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " remove all the entries
+ call g:Xsetlist([], 'r', {'lines' : []})
+ call assert_equal([''], getline(1, '$'))
+ call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " add a new list
+ call g:Xsetlist([], ' ', {'lines' : ['F4:4: line4']})
+ call assert_equal(['F4|4| line4'], getline(1, '$'))
+ call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
+
+ " Test setqflist() using the 'items' key in 'what'
+ " add a new entry
+ call g:Xsetlist([], 'a', {'items' : [{'filename' : 'F5', 'lnum' : 5, 'text'
: 'line5'}]})
+ call assert_equal(['F4|4| line4', 'F5|5| line5'], getline(1, '$'))
+ call assert_equal(2, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " replace all the entries with a single entry
+ call g:Xsetlist([], 'r', {'items' : [{'filename' : 'F6', 'lnum' : 6, 'text'
: 'line6'}]})
+ call assert_equal(['F6|6| line6'], getline(1, '$'))
+ call assert_equal(3, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " remove all the entries
+ call g:Xsetlist([], 'r', {'items' : []})
+ call assert_equal([''], getline(1, '$'))
+ call assert_equal(4, g:Xgetlist({'changedtick' : 0}).changedtick)
+ " add a new list
+ call g:Xsetlist([], ' ', {'items' : [{'filename' : 'F7', 'lnum' : 7, 'text'
: 'line7'}]})
+ call assert_equal(['F7|7| line7'], getline(1, '$'))
+ call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
+
+ call g:Xsetlist([], ' ', {})
+ call assert_equal([''], getline(1, '$'))
+ call assert_equal(1, g:Xgetlist({'changedtick' : 0}).changedtick)
+
+ Xclose
+ endfunc
+
+ func Test_qfbuf_update()
+ call Xqfbuf_update('c')
+ call Xqfbuf_update('l')
+ endfunc
+
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-8.2.2068/src/version.c 2020-11-29 14:11:33.163022803 +0100
--- src/version.c 2020-11-29 14:19:56.249563104 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2069,
/**/
--
ARTHUR: I am your king!
WOMAN: Well, I didn't vote for you.
ARTHUR: You don't vote for kings.
WOMAN: Well, 'ow did you become king then?
The Quest for the Holy Grail (Monty Python)
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202011291321.0ATDL0so3257314%40masaka.moolenaar.net.