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:
David Bürgin
2015-04-25 20:01:33 +02:00
committed by Justin M. Keyes
parent af863d46a9
commit 5a1a2ba783
4 changed files with 10 additions and 6 deletions

View File

@@ -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*

View File

@@ -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

View File

@@ -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 */

View File

@@ -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)