On Thu, Jul 12, 2012 at 03:49:32PM -0700, Axel wrote:
> Command sequence 2
> ------------------
> :noh
> :call X()
> 
> function X()
>    let @/="xxxx"
>    normal n
> endfunction
> 
> >>> does not highlight "xxxx"
> 
> Can anyone confirm this behavior?

Yes, and it's expected.  From :help :noh

  This command doesn't work in an autocommand, because
  the highlighting state is saved and restored when
  executing autocommands |autocmd-searchpat|.
  Same thing for when invoking a user function.

and autocmd-searchpat mentions

  This means that autocommands do not affect the strings
  highlighted wit the |'hlsearch'| option.

Cheers,
-- 
James
GPG Key: 4096R/331BA3DB 2011-12-05 James McCoy <[email protected]>

Attachment: signature.asc
Description: Digital signature

Raspunde prin e-mail lui