vim-patch:8.1.1970: search stat space wrong, no test for 8.1.1965

Problem:    Search stat space wrong, no test for 8.1.1965.
Solution:   Fix check for cmd_silent.  Add a test. (Christian Brabandt)
19e8ac72e9
This commit is contained in:
Jan Edmund Lazo 2020-09-29 19:26:35 -04:00
parent 621f7b607f
commit 37c6cbc758
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15
2 changed files with 23 additions and 2 deletions

View File

@ -1198,7 +1198,7 @@ int do_search(
// msg_strtrunc() will shorten in the middle.
if (ui_has(kUIMessages)) {
len = 0; // adjusted below
} else if (msg_scrolled != 0 || cmd_silent) {
} else if (msg_scrolled != 0 && !cmd_silent) {
// Use all the columns.
len = (Rows - msg_row) * Columns - 1;
} else {

View File

@ -162,8 +162,29 @@ 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