aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Bürgin <676c7473@gmail.com>2015-04-25 20:01:33 +0200
committerJustin M. Keyes <justinkz@gmail.com>2015-04-27 02:10:57 -0400
commit5a1a2ba783ba174567ff1c1044b9f0b01b61a0fb (patch)
tree341ddc468821cc469e0ae894f8de30d564a5795d
parentaf863d46a99aa5d14ff7524dbf17764520554f2b (diff)
downloadrneovim-5a1a2ba783ba174567ff1c1044b9f0b01b61a0fb.tar.gz
rneovim-5a1a2ba783ba174567ff1c1044b9f0b01b61a0fb.tar.bz2
rneovim-5a1a2ba783ba174567ff1c1044b9f0b01b61a0fb.zip
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
-rw-r--r--runtime/doc/eval.txt8
-rw-r--r--src/nvim/version.c2
-rw-r--r--src/nvim/vim.h2
-rw-r--r--test/functional/legacy/101_hlsearch_spec.lua4
4 files changed, 10 insertions, 6 deletions
diff --git a/runtime/doc/eval.txt b/runtime/doc/eval.txt
index a9ed4acb19..0284e6cab8 100644
--- a/runtime/doc/eval.txt
+++ b/runtime/doc/eval.txt
@@ -1455,10 +1455,10 @@ v:foldstart Used for 'foldtext': first line of closed fold.
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. Setting
+ this variable to zero acts like the |:nohlsearch| command,
+ setting it to one acts like >
let &hlsearch = &hlsearch
<
*v:insertmode* *insertmode-variable*
diff --git a/src/nvim/version.c b/src/nvim/version.c
index 8ef6ae8ee8..d1ba6e473e 100644
--- a/src/nvim/version.c
+++ b/src/nvim/version.c
@@ -232,7 +232,7 @@ static int included_patches[] = {
//540 NA
//539,
538,
- //537,
+ 537,
536,
//535,
//534 NA
diff --git a/src/nvim/vim.h b/src/nvim/vim.h
index 796267dd0d..41fcff129c 100644
--- a/src/nvim/vim.h
+++ b/src/nvim/vim.h
@@ -351,6 +351,6 @@ enum {
#include "nvim/ex_cmds_defs.h" /* Ex command defines */
# 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 */
diff --git a/test/functional/legacy/101_hlsearch_spec.lua b/test/functional/legacy/101_hlsearch_spec.lua
index 3c44f02edb..4b8b1cef50 100644
--- a/test/functional/legacy/101_hlsearch_spec.lua
+++ b/test/functional/legacy/101_hlsearch_spec.lua
@@ -32,6 +32,9 @@ describe('v:hlsearch', function()
execute('AddR')
execute('/')
execute('AddR')
+ execute('set nohls')
+ execute('/')
+ execute('AddR')
execute('let r1=r[0][0]')
-- I guess it is not guaranteed that screenattr outputs always the same character
@@ -58,6 +61,7 @@ describe('v:hlsearch', function()
1:highlighted
0:not highlighted
1:highlighted
+ 0:not highlighted
Vim(let):E706:]])
end)
end)