1
0
forked from aniani/vim

patch 8.1.0165: :clist output can be very long

Problem:    :clist output can be very long.
Solution:   Support filtering :clist entries. (Yegappan Lakshmanan)
This commit is contained in:
Bram Moolenaar
2018-07-08 16:01:08 +02:00
parent fd35811ca5
commit 4cde86c2ef
3 changed files with 36 additions and 1 deletions

View File

@@ -3487,3 +3487,20 @@ func Test_autocmd_changelist()
call Xautocmd_changelist('c')
call Xautocmd_changelist('l')
endfunc
" Tests for the ':filter /pat/ clist' command
func Test_filter_clist()
cexpr ['Xfile1:10:10:Line 10', 'Xfile2:15:15:Line 15']
call assert_equal([' 2 Xfile2:15 col 15: Line 15'],
\ split(execute('filter /Line 15/ clist'), "\n"))
call assert_equal([' 1 Xfile1:10 col 10: Line 10'],
\ split(execute('filter /Xfile1/ clist'), "\n"))
call assert_equal([], split(execute('filter /abc/ clist'), "\n"))
call setqflist([{'module' : 'abc', 'pattern' : 'pat1'},
\ {'module' : 'pqr', 'pattern' : 'pat2'}], ' ')
call assert_equal([' 2 pqr:pat2: '],
\ split(execute('filter /pqr/ clist'), "\n"))
call assert_equal([' 1 abc:pat1: '],
\ split(execute('filter /pat1/ clist'), "\n"))
endfunc