mirror of
https://github.com/neovim/neovim.git
synced 2025-10-05 01:16:31 +00:00
vim-patch:8.2.2797: Search highlight disappears in the Visual area (#17947)
Problem: Search highlight disappears in the Visual area.
Solution: Combine the search attributes. (closes vim/vim#8134)
2d5f385cee
This commit is contained in:
@@ -3006,6 +3006,10 @@ static int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool noc
|
||||
|
||||
if (area_attr != 0) {
|
||||
char_attr = hl_combine_attr(line_attr, area_attr);
|
||||
if (!highlight_match) {
|
||||
// let search highlight show in Visual area if possible
|
||||
char_attr = hl_combine_attr(search_attr, char_attr);
|
||||
}
|
||||
} else if (search_attr != 0) {
|
||||
char_attr = hl_combine_attr(line_attr, search_attr);
|
||||
}
|
||||
|
@@ -925,6 +925,26 @@ func Test_hlsearch_block_visual_match()
|
||||
call delete('Xhlsearch_block')
|
||||
endfunc
|
||||
|
||||
func Test_hlsearch_and_visual()
|
||||
CheckOption hlsearch
|
||||
CheckScreendump
|
||||
|
||||
call writefile([
|
||||
\ 'set hlsearch',
|
||||
\ 'call setline(1, repeat(["xxx yyy zzz"], 3))',
|
||||
\ 'hi Search cterm=bold',
|
||||
\ '/yyy',
|
||||
\ 'call cursor(1, 6)',
|
||||
\ ], 'Xhlvisual_script')
|
||||
let buf = RunVimInTerminal('-S Xhlvisual_script', {'rows': 6, 'cols': 40})
|
||||
call term_sendkeys(buf, "vjj")
|
||||
call VerifyScreenDump(buf, 'Test_hlsearch_visual_1', {})
|
||||
call term_sendkeys(buf, "\<Esc>")
|
||||
|
||||
call StopVimInTerminal(buf)
|
||||
call delete('Xhlvisual_script')
|
||||
endfunc
|
||||
|
||||
func Test_incsearch_substitute()
|
||||
CheckFunction test_override
|
||||
CheckOption incsearch
|
||||
|
Reference in New Issue
Block a user