On Mi, 22 Okt 2014, Bram Moolenaar wrote:

> Well, the docs suggest that v:hlsearch reflects the value of the
> internal no_hlsearch flag.  Thus the user is expected to check the 'hls'
> option as well. 

Hm, Yes but the user usually does not know about the no_hlsearch flag. I 
still find it, well interestingly, that this returns 1 if 'nohls' is 
set. I'll just attach a patch that changes it and enhances the test.

> Especially because setting v:hlsearch to 1 does not
> mean enabling the option.

True and that wouldn't change with my patch.

Best,
Christian
-- 
    /|__
   ///,-`
   $ $ ,
   | .' ",
   (_)\  ""-------.
       : CA$Hmere  \.
       | /.____.\ ||\\
       ())       ()) "
       |||       |||
       <>>       <>>
        Yuppie-MULI

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/testdir/test101.in b/src/testdir/test101.in
--- 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")')
diff --git a/src/testdir/test101.ok b/src/testdir/test101.ok
--- 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:
diff --git a/src/vim.h b/src/vim.h
--- a/src/vim.h
+++ b/src/vim.h
@@ -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

Raspunde prin e-mail lui