mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.2.2797: Search highlight disappears in the Visual area
Problem: Search highlight disappears in the Visual area. Solution: Combine the search attributes. (closes #8134)
This commit is contained in:
parent
753bcf8c7d
commit
2d5f385cee
@ -1538,6 +1538,9 @@ win_line(
|
|||||||
if (area_attr != 0)
|
if (area_attr != 0)
|
||||||
{
|
{
|
||||||
char_attr = hl_combine_attr(line_attr, area_attr);
|
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);
|
||||||
# ifdef FEAT_SYN_HL
|
# ifdef FEAT_SYN_HL
|
||||||
char_attr = hl_combine_attr(syntax_attr, char_attr);
|
char_attr = hl_combine_attr(syntax_attr, char_attr);
|
||||||
# endif
|
# endif
|
||||||
|
6
src/testdir/dumps/Test_hlsearch_visual_1.dump
Normal file
6
src/testdir/dumps/Test_hlsearch_visual_1.dump
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|x+0&#ffffff0@2| |y+2&#ffff4012|y+2&#e0e0e08@1| +0&&|z@2| | +0&#ffffff0@27
|
||||||
|
|x+0&#e0e0e08@2| |y+2&&@2| +0&&|z@2| | +0&#ffffff0@27
|
||||||
|
|x+0&#e0e0e08@2| |y+2&&>y+2&#ffff4012@1| +0&#ffffff0|z@2| @28
|
||||||
|
|~+0#4040ff13&| @38
|
||||||
|
|~| @38
|
||||||
|
|-+2#0000000&@1| |V|I|S|U|A|L| |-@1|3+0&&| @8|3|,|6| @10|A|l@1|
|
@ -964,6 +964,26 @@ func Test_hlsearch_dump()
|
|||||||
call delete('Xhlsearch_script')
|
call delete('Xhlsearch_script')
|
||||||
endfunc
|
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()
|
func Test_incsearch_substitute()
|
||||||
CheckOption incsearch
|
CheckOption incsearch
|
||||||
|
|
||||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
2797,
|
||||||
/**/
|
/**/
|
||||||
2796,
|
2796,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user