Christian Brabandt wrote:
> On Mon, March 19, 2012 13:02, Constantin Stefanov wrote:
>> Hello.
>>
>> I have the map:
>>
>> nnoremap <silent><Esc><Esc> :call Clearhl()<CR>
>> func Clearhl()
>> nohlsearch
>> endfunc
>>
>> When I press Esc twice, search highlighting is switched off, but when
>> after that cursor points to parenthesis ('([' works) the hihglightining
>> is on again.
>>
>> If I type :nohl in normal mode, or chenge map to
>> nnoremap <silent><Esc><Esc> :nohlsearch<CR>
>> the highlightining is not switched on back when pointing to parenthesis.
>>
>> How can I make nohlsearch in function work in the same way as in normal
>> mode or map?
>
> I think what you noticed is documented under
> :h function-search-undo
As I understood from there, effect from :nohlsearch must be reverted on
return from the function. But it does not happen, search highlist
remains off afterretrun from the function, but only untiil I put cursor
on any bracket, and only then it is reverted.
--
Constantin Stefanov
--
You received this message from the "vim_use" 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