diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-07 07:57:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-07 07:57:29 +0800 |
commit | 9e34aa76c132b5637ed2f2dafa4487f4c850bf35 (patch) | |
tree | 263b1f59a368577352fd809f4bfb021acec4b176 /test/functional | |
parent | e218965338ad8020935a10e678d2a7c6a059ee43 (diff) | |
download | rneovim-9e34aa76c132b5637ed2f2dafa4487f4c850bf35.tar.gz rneovim-9e34aa76c132b5637ed2f2dafa4487f4c850bf35.tar.bz2 rneovim-9e34aa76c132b5637ed2f2dafa4487f4c850bf35.zip |
vim-patch:9.0.1518: search stats not always visible when searching backwards (#23517)
Problem: Search stats not always visible when searching backwards.
Solution: Do not display the top/bot message on top of the search stats.
(Christian Brabandt, closes vim/vim#12322, closes vim/vim#12222)
https://github.com/vim/vim/commit/34a6a3617b5b6ce11372439f14762caddc4b0cea
Co-authored-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/legacy/search_stat_spec.lua | 56 |
1 files changed, 55 insertions, 1 deletions
diff --git a/test/functional/legacy/search_stat_spec.lua b/test/functional/legacy/search_stat_spec.lua index 06e0b2320a..bd5ab68e5c 100644 --- a/test/functional/legacy/search_stat_spec.lua +++ b/test/functional/legacy/search_stat_spec.lua @@ -10,8 +10,9 @@ describe('search stat', function() screen:set_default_attr_ids({ [1] = {bold = true, foreground = Screen.colors.Blue}, -- NonText [2] = {background = Screen.colors.Yellow}, -- Search - [3] = {foreground = Screen.colors.Blue4, background = Screen.colors.LightGrey}, -- Folded + [3] = {foreground = Screen.colors.DarkBlue, background = Screen.colors.LightGrey}, -- Folded [4] = {reverse = true}, -- IncSearch, TabLineFill + [5] = {foreground = Screen.colors.Red}, -- WarningMsg }) screen:attach() end) @@ -183,4 +184,57 @@ describe('search stat', function() /abc^ | ]]) end) + + -- oldtest: Test_search_stat_backwards() + it('when searching backwards', function() + screen:try_resize(60, 10) + exec([[ + set shm-=S + call setline(1, ['test', '']) + ]]) + + feed('*') + screen:expect([[ + {2:^test} | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + /\<test\> [1/1] | + ]]) + + feed('N') + screen:expect([[ + {2:^test} | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + ?\<test\> [1/1] | + ]]) + + command('set shm+=S') + feed('N') + -- shows "Search Hit Bottom.." + screen:expect([[ + {2:^test} | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + {5:search hit TOP, continuing at BOTTOM} | + ]]) + end) end) |