summaryrefslogtreecommitdiff
path: root/src/testdir/test_search_stat.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-05-24 22:08:15 +0200
committerBram Moolenaar <Bram@vim.org>2019-05-24 22:08:15 +0200
commit8f46e4c4bde13fd5ad68a6670b79cc462b65fbec (patch)
treefd1171bb8285f800b7621411d9ba742d2e5f6e39 /src/testdir/test_search_stat.vim
parent7b31a181c84ec6b9050892e80f3132907569f8d8 (diff)
downloadvim-git-8f46e4c4bde13fd5ad68a6670b79cc462b65fbec.tar.gz
patch 8.1.1390: search stats are off when using count or offsetv8.1.1390
Problem: Search stats are off when using count or offset. Solution: Recompute the stats when needed. (Masato Nishihata, closes #4410)
Diffstat (limited to 'src/testdir/test_search_stat.vim')
-rw-r--r--src/testdir/test_search_stat.vim19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/testdir/test_search_stat.vim b/src/testdir/test_search_stat.vim
index ad46b2d05..cf36f3214 100644
--- a/src/testdir/test_search_stat.vim
+++ b/src/testdir/test_search_stat.vim
@@ -117,6 +117,25 @@ func! Test_search_stat()
call assert_false(1)
endtry
+ " with count
+ call cursor(1, 1)
+ let @/ = 'fo*\(bar\?\)\?'
+ let g:a = execute(':unsilent :norm! 2n')
+ let stat = '\[3/50\]'
+ let pat = escape(@/, '()*?'). '\s\+'
+ call assert_match(pat .. stat, g:a)
+ let g:a = execute(':unsilent :norm! 2n')
+ let stat = '\[5/50\]'
+ call assert_match(pat .. stat, g:a)
+
+ " with offset
+ call cursor(1, 1)
+ call feedkeys("/fo*\\(bar\\?\\)\\?/+1\<cr>", 'tx')
+ let g:a = execute(':unsilent :norm! n')
+ let stat = '\[5/50\]'
+ let pat = escape(@/ .. '/+1', '()*?'). '\s\+'
+ call assert_match(pat .. stat, g:a)
+
" normal, n comes from a mapping
" Need to move over more than 64 lines to trigger char_avail(.
nnoremap n nzv