mirror of
https://github.com/neovim/neovim.git
synced 2026-04-20 14:25:32 +00:00
vim-patch:8.2.4378: incsearch HL broken when calling searchcount in 'tabLine' (#19147)
Problem: Incsearch highlight broken when calling searchcount() in 'tabLine'
function. (Mirko Palmer)
Solution: Save and restore the incsearch state. (Christian Brabandt,
closes vim/vim#9763, closes vim/vim#9633)
6dd7424c7e
This commit is contained in:
@@ -12,6 +12,7 @@ describe('search stat', function()
|
||||
[1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText
|
||||
[2] = {background = Screen.colors.Yellow}, -- Search
|
||||
[3] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey}, -- Folded
|
||||
[4] = {reverse = true}, -- IncSearch, TabLineFill
|
||||
})
|
||||
screen:attach()
|
||||
end)
|
||||
@@ -118,4 +119,66 @@ describe('search stat', function()
|
||||
|
|
||||
]])
|
||||
end)
|
||||
|
||||
it('is not broken by calling searchcount() in tabline vim-patch:8.2.4378', function()
|
||||
exec([[
|
||||
call setline(1, ['abc--c', '--------abc', '--abc'])
|
||||
set hlsearch
|
||||
set incsearch
|
||||
set showtabline=2
|
||||
|
||||
function MyTabLine()
|
||||
try
|
||||
let a=searchcount(#{recompute: 1, maxcount: -1})
|
||||
return a.current .. '/' .. a.total
|
||||
catch
|
||||
return ''
|
||||
endtry
|
||||
endfunction
|
||||
|
||||
set tabline=%!MyTabLine()
|
||||
]])
|
||||
|
||||
feed('/abc')
|
||||
screen:expect([[
|
||||
{4: }|
|
||||
{2:abc}--c |
|
||||
--------{4:abc} |
|
||||
--{2:abc} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
/abc^ |
|
||||
]])
|
||||
|
||||
feed('<C-G>')
|
||||
screen:expect([[
|
||||
{4:3/3 }|
|
||||
{2:abc}--c |
|
||||
--------{2:abc} |
|
||||
--{4:abc} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
/abc^ |
|
||||
]])
|
||||
|
||||
feed('<C-G>')
|
||||
screen:expect([[
|
||||
{4:1/3 }|
|
||||
{4:abc}--c |
|
||||
--------{2:abc} |
|
||||
--{2:abc} |
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
{1:~ }|
|
||||
/abc^ |
|
||||
]])
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user