mirror of
https://github.com/neovim/neovim.git
synced 2025-10-21 17:21:49 +00:00
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:
@@ -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
|
||||
|
15
src/nvim/testdir/test_filter_cmd.vim
Normal file
15
src/nvim/testdir/test_filter_cmd.vim
Normal 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
|
Reference in New Issue
Block a user