From 7bd97127b4e45dcef1159603834b04ef0dcadfd7 Mon Sep 17 00:00:00 2001 From: James McCoy Date: Sat, 29 Apr 2017 07:58:49 -0400 Subject: 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. https://github.com/vim/vim/commit/7b668e83d0635d082b7ec90d7d2aa30a9d7d8928 --- src/nvim/testdir/test_alot.vim | 1 + src/nvim/testdir/test_filter_cmd.vim | 15 +++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/nvim/testdir/test_filter_cmd.vim (limited to 'src/nvim/testdir') diff --git a/src/nvim/testdir/test_alot.vim b/src/nvim/testdir/test_alot.vim index 99d9835996..5da9a8b0f4 100644 --- a/src/nvim/testdir/test_alot.vim +++ b/src/nvim/testdir/test_alot.vim @@ -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 diff --git a/src/nvim/testdir/test_filter_cmd.vim b/src/nvim/testdir/test_filter_cmd.vim new file mode 100644 index 0000000000..f85a11ce45 --- /dev/null +++ b/src/nvim/testdir/test_filter_cmd.vim @@ -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 -- cgit