diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-03 22:23:38 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-03 22:23:38 +0200 |
commit | 19e8ac72e9c17b894a9c74cb8f70feb33567033c (patch) | |
tree | 3799cde2dad44f4c4280a618514ca6be47d45442 | |
parent | 581ba39aefe837298a9943b04a1dab13a7ec6772 (diff) | |
download | vim-git-19e8ac72e9c17b894a9c74cb8f70feb33567033c.tar.gz |
patch 8.1.1970: search stat space wrong, no test for 8.1.1965v8.1.1970
Problem: Search stat space wrong, no test for 8.1.1965.
Solution: Fix check for cmd_silent. Add a test. (Christian Brabandt)
-rw-r--r-- | src/search.c | 2 | ||||
-rw-r--r-- | src/testdir/test_search_stat.vim | 23 | ||||
-rw-r--r-- | src/version.c | 2 |
3 files changed, 25 insertions, 2 deletions
diff --git a/src/search.c b/src/search.c index 758c4ef1a..ee66052a9 100644 --- a/src/search.c +++ b/src/search.c @@ -1391,7 +1391,7 @@ do_search( // search stat. Use all the space available, so that the // search state is right aligned. If there is not enough space // msg_strtrunc() will shorten in the middle. - if (msg_scrolled != 0 || cmd_silent) + if (msg_scrolled != 0 && !cmd_silent) // Use all the columns. len = (int)(Rows - msg_row) * Columns - 1; else diff --git a/src/testdir/test_search_stat.vim b/src/testdir/test_search_stat.vim index cf36f3214..d5d50ff1d 100644 --- a/src/testdir/test_search_stat.vim +++ b/src/testdir/test_search_stat.vim @@ -160,7 +160,28 @@ func! Test_search_stat() let stat = '\[1/2\]' call assert_notmatch(pat .. stat, g:a) - " close the window + " normal, n comes from a silent mapping + " First test a normal mapping, then a silent mapping + call cursor(1,1) + nnoremap n n + let @/ = 'find this' + let pat = '/find this\s\+' + let g:a = execute(':unsilent :norm n') + let g:b = split(g:a, "\n")[-1] + let stat = '\[1/2\]' + call assert_match(pat .. stat, g:b) + nnoremap <silent> n n + call cursor(1,1) + let g:a = execute(':unsilent :norm n') + let g:b = split(g:a, "\n")[-1] + let stat = '\[1/2\]' + call assert_notmatch(pat .. stat, g:b) + call assert_match(stat, g:b) + unmap n + + " Clean up set shortmess+=S + + " close the window bwipe! endfunc diff --git a/src/version.c b/src/version.c index 655b68a99..7b3fff0f9 100644 --- a/src/version.c +++ b/src/version.c @@ -762,6 +762,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1970, +/**/ 1969, /**/ 1968, |