vim-patch:7.4.2244

Problem:    Adding pattern to ":oldfiles" is not a generic solution.
Solution:   Add the ":filter /pat/ cmd" command modifier.  Only works for some
            commands right now.

7b668e83d0
This commit is contained in:
James McCoy
2017-04-29 07:58:49 -04:00
parent 059c3fc2f9
commit 7bd97127b4
8 changed files with 105 additions and 30 deletions

View File

@@ -8,6 +8,7 @@ source test_ex_undo.vim
source test_expr.vim
source test_expr_utf8.vim
source test_feedkeys.vim
source test_filter_cmd.vim
source test_filter_map.vim
source test_goto.vim
source test_jumps.vim

View File

@@ -0,0 +1,15 @@
" Test the :filter command modifier
func Test_filter()
edit Xdoesnotmatch
edit Xwillmatch
call assert_equal('"Xwillmatch"', substitute(execute('filter willma ls'), '[^"]*\(".*"\)[^"]*', '\1', ''))
endfunc
func Test_filter_fails()
call assert_fails('filter', 'E471:')
call assert_fails('filter pat', 'E476:')
call assert_fails('filter /pat', 'E476:')
call assert_fails('filter /pat/', 'E476:')
call assert_fails('filter /pat/ asdf', 'E492:')
endfunc