Shotaro Aoyama wrote:
> Using :noh in a user-defined function has no effect.
> Is this a bug or intended?
>
> To reproduce:
>
> $ vim -u NONE -N
>
> function! Noh()
> noh
> endfunction
> set hlsearch
>
> " search /foo
>
> :call Noh()
>
> " Now, the hilight doesn't turn off.
After a function returns the search patterns are restored. That also
includes the status for highlighting their matches. I can't think of
another solution right now, you will have to find a way to keep
":nohlseach" outside of the function.
--
GALAHAD: Camelot ...
LAUNCELOT: Camelot ...
GAWAIN: It's only a model.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---