diff src/testdir/test_quickfix.vim @ 20762:68170c89e355 v8.2.0933

patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list Commit: https://github.com/vim/vim/commit/7ba5a7eff335dcce25afaa154f32eeadb6014b61 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jun 8 19:20:27 2020 +0200 patch 8.2.0933: 'quickfixtextfunc' does not get window ID of location list Problem: 'quickfixtextfunc' does not get window ID of location list. Solution: Add "winid" to the dict argument. (Yegappan Lakshmanan, closes #6222)
author Bram Moolenaar <Bram@vim.org>
date Mon, 08 Jun 2020 19:30:03 +0200
parents ada6f26e6eb1
children 3c61d8ec36af
line wrap: on
line diff
--- a/src/testdir/test_quickfix.vim
+++ b/src/testdir/test_quickfix.vim
@@ -4822,7 +4822,7 @@ func Tqfexpr(info)
     let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx,
           \ 'items' : 1}).items
   else
-    let qfl = getloclist(0, {'id' : a:info.id, 'idx' : a:info.idx,
+    let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'idx' : a:info.idx,
           \ 'items' : 1}).items
   endif
 
@@ -4863,7 +4863,7 @@ func Xtest_qftextfunc(cchar)
       let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx,
             \ 'items' : 1}).items
     else
-      let qfl = getloclist(0, {'id' : a:info.id, 'idx' : a:info.idx,
+      let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'idx' : a:info.idx,
             \ 'items' : 1}).items
     endif
     if empty(qfl)
@@ -4878,6 +4878,11 @@ func Xtest_qftextfunc(cchar)
   call assert_equal('Line 10, Col 2', getline(1))
   call assert_equal('Line 20, Col 4', getline(2))
   Xclose
+  " Add entries to the list when the quickfix buffer is hidden
+  Xaddexpr ['F1:30:6:red']
+  Xwindow
+  call assert_equal('Line 30, Col 6', getline(3))
+  Xclose
   call g:Xsetlist([], 'r', {'quickfixtextfunc' : ''})
   set quickfixtextfunc&
   delfunc PerQfText