Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
20761:8eb1d42ec2c9 | 20762:68170c89e355 |
---|---|
4820 func Tqfexpr(info) | 4820 func Tqfexpr(info) |
4821 if a:info.quickfix | 4821 if a:info.quickfix |
4822 let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx, | 4822 let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx, |
4823 \ 'items' : 1}).items | 4823 \ 'items' : 1}).items |
4824 else | 4824 else |
4825 let qfl = getloclist(0, {'id' : a:info.id, 'idx' : a:info.idx, | 4825 let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'idx' : a:info.idx, |
4826 \ 'items' : 1}).items | 4826 \ 'items' : 1}).items |
4827 endif | 4827 endif |
4828 | 4828 |
4829 let e = qfl[0] | 4829 let e = qfl[0] |
4830 let s = '' | 4830 let s = '' |
4861 func PerQfText(info) | 4861 func PerQfText(info) |
4862 if a:info.quickfix | 4862 if a:info.quickfix |
4863 let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx, | 4863 let qfl = getqflist({'id' : a:info.id, 'idx' : a:info.idx, |
4864 \ 'items' : 1}).items | 4864 \ 'items' : 1}).items |
4865 else | 4865 else |
4866 let qfl = getloclist(0, {'id' : a:info.id, 'idx' : a:info.idx, | 4866 let qfl = getloclist(a:info.winid, {'id' : a:info.id, 'idx' : a:info.idx, |
4867 \ 'items' : 1}).items | 4867 \ 'items' : 1}).items |
4868 endif | 4868 endif |
4869 if empty(qfl) | 4869 if empty(qfl) |
4870 return '' | 4870 return '' |
4871 endif | 4871 endif |
4876 Xaddexpr ['F1:10:2:green', 'F1:20:4:blue'] | 4876 Xaddexpr ['F1:10:2:green', 'F1:20:4:blue'] |
4877 Xwindow | 4877 Xwindow |
4878 call assert_equal('Line 10, Col 2', getline(1)) | 4878 call assert_equal('Line 10, Col 2', getline(1)) |
4879 call assert_equal('Line 20, Col 4', getline(2)) | 4879 call assert_equal('Line 20, Col 4', getline(2)) |
4880 Xclose | 4880 Xclose |
4881 " Add entries to the list when the quickfix buffer is hidden | |
4882 Xaddexpr ['F1:30:6:red'] | |
4883 Xwindow | |
4884 call assert_equal('Line 30, Col 6', getline(3)) | |
4885 Xclose | |
4881 call g:Xsetlist([], 'r', {'quickfixtextfunc' : ''}) | 4886 call g:Xsetlist([], 'r', {'quickfixtextfunc' : ''}) |
4882 set quickfixtextfunc& | 4887 set quickfixtextfunc& |
4883 delfunc PerQfText | 4888 delfunc PerQfText |
4884 | 4889 |
4885 " Non-existing function | 4890 " Non-existing function |