annotate src/testdir/test_search_stat.vim @ 16746:73ff6357da5b v8.1.1375

patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often commit https://github.com/vim/vim/commit/984f031fb02fe301a8dbf8a35b871c9f60b8f61e Author: Bram Moolenaar <Bram@vim.org> Date: Fri May 24 13:11:47 2019 +0200 patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often Problem: Without "TS" in 'shortmess' get a hit-enter prompt often. Solution: Always truncate the search message. Also avoid putting it in the message history. (closes #4413)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 May 2019 13:15:05 +0200
parents b1756c303066
children 7d4c814a8554
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
1 " Tests for search_stats, when "S" is not in 'shortmess'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
2 "
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
3 " This test is fragile, it might not work interactively, but it works when run
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
4 " as test!
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
5
16560
8d0ea09e2d81 patch 8.1.1283: delaying half a second after the top-bot message
Bram Moolenaar <Bram@vim.org>
parents: 16533
diff changeset
6 source shared.vim
8d0ea09e2d81 patch 8.1.1283: delaying half a second after the top-bot message
Bram Moolenaar <Bram@vim.org>
parents: 16533
diff changeset
7
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
8 func! Test_search_stat()
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
9 new
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
10 set shortmess-=S
16570
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
11 " Append 50 lines with text to search for, "foobar" appears 20 times
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
12 call append(0, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10))
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
13
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
14 " match at second line
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
15 call cursor(1, 1)
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
16 let messages_before = execute('messages')
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
17 let @/ = 'fo*\(bar\?\)\?'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
18 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
19 let stat = '\[2/50\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
20 let pat = escape(@/, '()*?'). '\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
21 call assert_match(pat .. stat, g:a)
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
22 " didn't get added to message history
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
23 call assert_equal(messages_before, execute('messages'))
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
24
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
25 " Match at last line
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
26 call cursor(line('$')-2, 1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
27 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
28 let stat = '\[50/50\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
29 call assert_match(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
30
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
31 " No search stat
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
32 set shortmess+=S
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
33 call cursor(1, 1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
34 let stat = '\[2/50\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
35 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
36 call assert_notmatch(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
37 set shortmess-=S
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
38
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
39 " Many matches
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
40 call cursor(line('$')-2, 1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
41 let @/ = '.'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
42 let pat = escape(@/, '()*?'). '\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
43 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
44 let stat = '\[>99/>99\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
45 call assert_match(pat .. stat, g:a)
16696
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
46 call cursor(line('$'), 1)
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
47 let g:a = execute(':unsilent :norm! n')
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
48 let stat = '\[1/>99\] W'
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
49 call assert_match(pat .. stat, g:a)
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
50
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
51 " Many matches
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
52 call cursor(1, 1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
53 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
54 let stat = '\[2/>99\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
55 call assert_match(pat .. stat, g:a)
16696
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
56 call cursor(1, 1)
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
57 let g:a = execute(':unsilent :norm! N')
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
58 let stat = '\[>99/>99\] W'
b1756c303066 patch 8.1.1350: "W" for wrapping not shown when more than 99 matches
Bram Moolenaar <Bram@vim.org>
parents: 16570
diff changeset
59 call assert_match(pat .. stat, g:a)
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
60
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
61 " right-left
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
62 if exists("+rightleft")
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
63 set rl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
64 call cursor(1,1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
65 let @/ = 'foobar'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
66 let pat = 'raboof/\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
67 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
68 let stat = '\[20/2\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
69 call assert_match(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
70 set norl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
71 endif
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
72
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
73 " right-left bottom
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
74 if exists("+rightleft")
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
75 set rl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
76 call cursor('$',1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
77 let pat = 'raboof?\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
78 let g:a = execute(':unsilent :norm! N')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
79 let stat = '\[20/20\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
80 call assert_match(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
81 set norl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
82 endif
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
83
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
84 " right-left back at top
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
85 if exists("+rightleft")
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
86 set rl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
87 call cursor('$',1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
88 let pat = 'raboof/\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
89 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
90 let stat = '\[20/1\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
91 call assert_match(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
92 call assert_match('search hit BOTTOM, continuing at TOP', g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
93 set norl
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
94 endif
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
95
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
96 " normal, back at bottom
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
97 call cursor(1,1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
98 let @/ = 'foobar'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
99 let pat = '?foobar\s\+'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
100 let g:a = execute(':unsilent :norm! N')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
101 let stat = '\[20/20\]'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
102 call assert_match(pat .. stat, g:a)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
103 call assert_match('search hit TOP, continuing at BOTTOM', g:a)
16560
8d0ea09e2d81 patch 8.1.1283: delaying half a second after the top-bot message
Bram Moolenaar <Bram@vim.org>
parents: 16533
diff changeset
104 call assert_match('\[20/20\] W', Screenline(&lines))
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
105
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
106 " normal, no match
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
107 call cursor(1,1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
108 let @/ = 'zzzzzz'
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
109 let g:a = ''
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
110 try
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
111 let g:a = execute(':unsilent :norm! n')
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
112 catch /^Vim\%((\a\+)\)\=:E486/
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
113 let stat = ''
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
114 " error message is not redir'ed to g:a, it is empty
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
115 call assert_true(empty(g:a))
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
116 catch
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
117 call assert_false(1)
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
118 endtry
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
119
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
120 " normal, n comes from a mapping
16570
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
121 " Need to move over more than 64 lines to trigger char_avail(.
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
122 nnoremap n nzv
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
123 call cursor(1,1)
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
124 call append(50, repeat(['foobar', 'foo', 'fooooobar', 'foba', 'foobar'], 10))
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
125 call setline(2, 'find this')
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
126 call setline(70, 'find this')
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
127 let @/ = 'find this'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
128 let pat = '/find this\s\+'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
129 let g:a = execute(':unsilent :norm n')
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
130 " g:a will contain several lines
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
131 let g:b = split(g:a, "\n")[-1]
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
132 let stat = '\[1/2\]'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
133 call assert_match(pat .. stat, g:b)
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
134 unmap n
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
135
16746
73ff6357da5b patch 8.1.1375: without "TS" in 'shortmess' get a hit-enter prompt often
Bram Moolenaar <Bram@vim.org>
parents: 16696
diff changeset
136 " normal, but silent
16570
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
137 call cursor(1,1)
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
138 let @/ = 'find this'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
139 let pat = '/find this\s\+'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
140 let g:a = execute(':norm! n')
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
141 let stat = '\[1/2\]'
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
142 call assert_notmatch(pat .. stat, g:a)
2c2f5f0173c1 patch 8.1.1288: search stats don't show for mapped command
Bram Moolenaar <Bram@vim.org>
parents: 16560
diff changeset
143
16533
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
144 " close the window
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
145 set shortmess+=S
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
146 bwipe!
5e25171e0e75 patch 8.1.1270: cannot see current match position
Bram Moolenaar <Bram@vim.org>
parents:
diff changeset
147 endfunc