comparison src/testdir/test_filter_cmd.vim @ 18454:b912277e3877 v8.1.2221

patch 8.1.2221: cannot filter :disp output Commit: https://github.com/vim/vim/commit/8fc42964363087025a27e8c80276c706536fc4e3 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 26 17:33:13 2019 +0200 patch 8.1.2221: cannot filter :disp output Problem: Cannot filter :disp output. Solution: Support filtereing :disp output. (Andi Massimino, closes https://github.com/vim/vim/issues/5117)
author Bram Moolenaar <Bram@vim.org>
date Sat, 26 Oct 2019 17:45:03 +0200
parents 9c206a78ec04
children 068337e86133
comparison
equal deleted inserted replaced
18453:043c07d16d60 18454:b912277e3877
143 143
144 bwipe! file.c 144 bwipe! file.c
145 bwipe! file.h 145 bwipe! file.h
146 bwipe! file.hs 146 bwipe! file.hs
147 endfunc 147 endfunc
148
149 func Test_filter_display()
150 edit Xdoesnotmatch
151 let @a = '!!willmatch'
152 let @b = '!!doesnotmatch'
153 let @c = "oneline\ntwoline\nwillmatch\n"
154 let @/ = '!!doesnotmatch'
155 call feedkeys(":echo '!!doesnotmatch:'\<CR>", 'ntx')
156 let lines = map(split(execute('filter /willmatch/ display'), "\n"), 'v:val[5:6]')
157
158 call assert_true(index(lines, '"a') >= 0)
159 call assert_false(index(lines, '"b') >= 0)
160 call assert_true(index(lines, '"c') >= 0)
161 call assert_false(index(lines, '"/') >= 0)
162 call assert_false(index(lines, '":') >= 0)
163 call assert_false(index(lines, '"%') >= 0)
164
165 let lines = map(split(execute('filter /doesnotmatch/ display'), "\n"), 'v:val[5:6]')
166 call assert_true(index(lines, '"a') < 0)
167 call assert_false(index(lines, '"b') < 0)
168 call assert_true(index(lines, '"c') < 0)
169 call assert_false(index(lines, '"/') < 0)
170 call assert_false(index(lines, '":') < 0)
171 call assert_false(index(lines, '"%') < 0)
172
173 bwipe!
174 endfunc