changeset 6413:01c668384bcc v7.4.537

updated for version 7.4.537 Problem: Value of v:hlsearch reflects an internal variable. Solution: Make the value reflect whether search highlighting is actually displayed. (Christian Brabandt)
author Bram Moolenaar <bram@vim.org>
date Thu, 27 Nov 2014 19:14:49 +0100
parents cf7754ebe684
children af110084ec06
files runtime/doc/eval.txt src/testdir/test101.in src/testdir/test101.ok src/version.c src/vim.h
diffstat 5 files changed, 12 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1457,10 +1457,10 @@ v:foldstart	Used for 'foldtext': first l
 		Read-only in the |sandbox|. |fold-foldtext|
 
 					*v:hlsearch* *hlsearch-variable*
-v:hlsearch	Variable that determines whether search highlighting is on. 
-		Makes sense only if 'hlsearch' is enabled which requires 
-		|+extra_search|. Setting this variable to zero acts the like 
-		|:nohlsearch| command, setting it to one acts like >
+v:hlsearch	Variable that indicates whether search highlighting is on. 
+		Setting it makes sense only if 'hlsearch' is enabled which
+		requires |+extra_search|. Setting this variable to zero acts
+		the like |:nohlsearch| command, setting it to one acts like >
 			let &hlsearch = &hlsearch
 <
 					*v:insertmode* *insertmode-variable*
--- a/src/testdir/test101.in
+++ b/src/testdir/test101.in
@@ -25,6 +25,9 @@ n:AddR
 :AddR
 /
 :AddR
+:set nohls
+/
+:AddR
 :let r1=r[0][0]
 :" I guess it is not guaranteed that screenattr outputs always the same character
 :call map(r, 'v:val[1].":".(v:val[0]==r1?"highlighted":"not highlighted")')
--- a/src/testdir/test101.ok
+++ b/src/testdir/test101.ok
@@ -8,4 +8,5 @@ 0:not highlighted
 1:highlighted
 0:not highlighted
 1:highlighted
+0:not highlighted
 Vim(let):E706:
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    537,
+/**/
     536,
 /**/
     535,
--- a/src/vim.h
+++ b/src/vim.h
@@ -1998,7 +1998,7 @@ typedef int VimClipboard;	/* This is req
 
 #ifndef FEAT_VIRTUALEDIT
 # define getvvcol(w, p, s, c, e) getvcol(w, p, s, c, e)
-# define virtual_active() 0
+# define virtual_active() FALSE
 # define virtual_op FALSE
 #endif
 
@@ -2277,7 +2277,7 @@ typedef int VimClipboard;	/* This is req
 #define AUTOLOAD_CHAR '#'
 
 #ifdef FEAT_EVAL
-# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch)
+# define SET_NO_HLSEARCH(flag) no_hlsearch = (flag); set_vim_var_nr(VV_HLSEARCH, !no_hlsearch && p_hls)
 #else
 # define SET_NO_HLSEARCH(flag) no_hlsearch = (flag)
 #endif