Mercurial > vim
comparison src/testdir/test_search_stat.vim @ 16570:2c2f5f0173c1 v8.1.1288
patch 8.1.1288: search stats don't show for mapped command
commit https://github.com/vim/vim/commit/9ce3fa828d238ff28d57b0092bb37575e20010ec
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue May 7 21:29:11 2019 +0200
patch 8.1.1288: search stats don't show for mapped command
Problem: Search stats don't show for mapped command.
Solution: Remove SEARCH_PEEK from searchit flags. Add a test. (Christian
Brabandt)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 07 May 2019 21:30:05 +0200 |
parents | 8d0ea09e2d81 |
children | b1756c303066 |
comparison
equal
deleted
inserted
replaced
16569:2eeb461f054f | 16570:2c2f5f0173c1 |
---|---|
6 source shared.vim | 6 source shared.vim |
7 | 7 |
8 func! Test_search_stat() | 8 func! Test_search_stat() |
9 new | 9 new |
10 set shortmess-=S | 10 set shortmess-=S |
11 " Append 50 lines with text to search for, "foobar" appears 20 times | |
11 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10)) | 12 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10)) |
12 | 13 |
13 " 1) match at second line | 14 " 1) match at second line |
14 call cursor(1, 1) | 15 call cursor(1, 1) |
15 let @/ = 'fo*\(bar\?\)\?' | 16 let @/ = 'fo*\(bar\?\)\?' |
103 call assert_true(empty(g:a)) | 104 call assert_true(empty(g:a)) |
104 catch | 105 catch |
105 call assert_false(1) | 106 call assert_false(1) |
106 endtry | 107 endtry |
107 | 108 |
109 " 11) normal, n comes from a mapping | |
110 " Need to move over more than 64 lines to trigger char_avail(. | |
111 nnoremap n nzv | |
112 call cursor(1,1) | |
113 call append(50, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10)) | |
114 call setline(2, 'find this') | |
115 call setline(70, 'find this') | |
116 let @/ = 'find this' | |
117 let pat = '/find this\s\+' | |
118 let g:a = execute(':unsilent :norm n') | |
119 " g:a will contain several lines | |
120 let g:b = split(g:a, "\n")[-1] | |
121 let stat = '\[1/2\]' | |
122 call assert_match(pat .. stat, g:b) | |
123 unmap n | |
124 | |
125 " 11) normal, but silent | |
126 call cursor(1,1) | |
127 let @/ = 'find this' | |
128 let pat = '/find this\s\+' | |
129 let g:a = execute(':norm! n') | |
130 let stat = '\[1/2\]' | |
131 call assert_notmatch(pat .. stat, g:a) | |
132 | |
108 " close the window | 133 " close the window |
109 set shortmess+=S | 134 set shortmess+=S |
110 bwipe! | 135 bwipe! |
111 endfunc | 136 endfunc |