mirror of
https://github.com/neovim/neovim.git
synced 2025-09-16 16:28:17 +00:00
vim-patch:7.4.537 #2509
Problem: Value of v:hlsearch reflects an internal variable. Solution: Make the value reflect whether search highlighting is actually displayed. (Christian Brabandt) https://github.com/vim/vim/releases/tag/v7-4-537
This commit is contained in:

committed by
Justin M. Keyes

parent
af863d46a9
commit
5a1a2ba783
@@ -1455,10 +1455,10 @@ v:foldstart Used for 'foldtext': first line of closed fold.
|
|||||||
Read-only in the |sandbox|. |fold-foldtext|
|
Read-only in the |sandbox|. |fold-foldtext|
|
||||||
|
|
||||||
*v:hlsearch* *hlsearch-variable*
|
*v:hlsearch* *hlsearch-variable*
|
||||||
v:hlsearch Variable that determines whether search highlighting is on.
|
v:hlsearch Variable that indicates whether search highlighting is on.
|
||||||
Makes sense only if 'hlsearch' is enabled which requires
|
Setting it makes sense only if 'hlsearch' is enabled. Setting
|
||||||
|+extra_search|. Setting this variable to zero acts the like
|
this variable to zero acts like the |:nohlsearch| command,
|
||||||
|:nohlsearch| command, setting it to one acts like >
|
setting it to one acts like >
|
||||||
let &hlsearch = &hlsearch
|
let &hlsearch = &hlsearch
|
||||||
<
|
<
|
||||||
*v:insertmode* *insertmode-variable*
|
*v:insertmode* *insertmode-variable*
|
||||||
|
@@ -232,7 +232,7 @@ static int included_patches[] = {
|
|||||||
//540 NA
|
//540 NA
|
||||||
//539,
|
//539,
|
||||||
538,
|
538,
|
||||||
//537,
|
537,
|
||||||
536,
|
536,
|
||||||
//535,
|
//535,
|
||||||
//534 NA
|
//534 NA
|
||||||
|
@@ -351,6 +351,6 @@ enum {
|
|||||||
#include "nvim/ex_cmds_defs.h" /* Ex command defines */
|
#include "nvim/ex_cmds_defs.h" /* Ex command defines */
|
||||||
|
|
||||||
# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr( \
|
# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr( \
|
||||||
VV_HLSEARCH, !no_hlsearch)
|
VV_HLSEARCH, !no_hlsearch && p_hls)
|
||||||
|
|
||||||
#endif /* NVIM_VIM_H */
|
#endif /* NVIM_VIM_H */
|
||||||
|
@@ -32,6 +32,9 @@ describe('v:hlsearch', function()
|
|||||||
execute('AddR')
|
execute('AddR')
|
||||||
execute('/')
|
execute('/')
|
||||||
execute('AddR')
|
execute('AddR')
|
||||||
|
execute('set nohls')
|
||||||
|
execute('/')
|
||||||
|
execute('AddR')
|
||||||
execute('let r1=r[0][0]')
|
execute('let r1=r[0][0]')
|
||||||
|
|
||||||
-- I guess it is not guaranteed that screenattr outputs always the same character
|
-- I guess it is not guaranteed that screenattr outputs always the same character
|
||||||
@@ -58,6 +61,7 @@ describe('v:hlsearch', function()
|
|||||||
1:highlighted
|
1:highlighted
|
||||||
0:not highlighted
|
0:not highlighted
|
||||||
1:highlighted
|
1:highlighted
|
||||||
|
0:not highlighted
|
||||||
Vim(let):E706:]])
|
Vim(let):E706:]])
|
||||||
end)
|
end)
|
||||||
end)
|
end)
|
||||||
|
Reference in New Issue
Block a user