aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-02-10 07:28:54 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-02-10 07:28:54 +0800
commitaea889fc06f0efb691cab92ebe2e46c52fe259b1 (patch)
tree7915519964bcab6a2d48d4c895ac60377350fa84 /src/nvim/testdir
parent90f2a851c761cde94eeb3e9dc7912413c8f04661 (diff)
downloadrneovim-aea889fc06f0efb691cab92ebe2e46c52fe259b1.tar.gz
rneovim-aea889fc06f0efb691cab92ebe2e46c52fe259b1.tar.bz2
rneovim-aea889fc06f0efb691cab92ebe2e46c52fe259b1.zip
vim-patch:8.1.2221: cannot filter :disp output
Problem: Cannot filter :disp output. Solution: Support filtereing :disp output. (Andi Massimino, closes vim/vim#5117) https://github.com/vim/vim/commit/8fc42964363087025a27e8c80276c706536fc4e3
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_filter_cmd.vim27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_filter_cmd.vim b/src/nvim/testdir/test_filter_cmd.vim
index 0c45db049b..144c7fa863 100644
--- a/src/nvim/testdir/test_filter_cmd.vim
+++ b/src/nvim/testdir/test_filter_cmd.vim
@@ -145,3 +145,30 @@ func Test_filter_commands()
bwipe! file.h
bwipe! file.hs
endfunc
+
+func Test_filter_display()
+ edit Xdoesnotmatch
+ let @a = '!!willmatch'
+ let @b = '!!doesnotmatch'
+ let @c = "oneline\ntwoline\nwillmatch\n"
+ let @/ = '!!doesnotmatch'
+ call feedkeys(":echo '!!doesnotmatch:'\<CR>", 'ntx')
+ let lines = map(split(execute('filter /willmatch/ display'), "\n"), 'v:val[5:6]')
+
+ call assert_true(index(lines, '"a') >= 0)
+ call assert_false(index(lines, '"b') >= 0)
+ call assert_true(index(lines, '"c') >= 0)
+ call assert_false(index(lines, '"/') >= 0)
+ call assert_false(index(lines, '":') >= 0)
+ call assert_false(index(lines, '"%') >= 0)
+
+ let lines = map(split(execute('filter /doesnotmatch/ display'), "\n"), 'v:val[5:6]')
+ call assert_true(index(lines, '"a') < 0)
+ call assert_false(index(lines, '"b') < 0)
+ call assert_true(index(lines, '"c') < 0)
+ call assert_false(index(lines, '"/') < 0)
+ call assert_false(index(lines, '":') < 0)
+ call assert_false(index(lines, '"%') < 0)
+
+ bwipe!
+endfunc