On 09/04/09 09:17, Maxim Kim wrote:
>
> Hi
>
> How can I check if highlight exists (was defined by a colorscheme)?
>
> For example if I define a group:
> :hi HelloWorld guifg=green
> I can check its existance with
> :echo hlexists("HelloWorld")
>
> And if I change colorscheme
> :colo desert
> highlight still exists but has "clear" status.
>
> So, is there a way I can check if that group was "cleared"?
>
> Maxim.
> >
>

func HlExists(hl)       " untested
        if !hlexists(a:hl)
                return 0
        endif
        redir => hlstatus
        exe "silent hi" a:hl
        redir END
        return (hlstatus !~ "cleared")
endfunc


Best regards,
Tony.
-- 
There cannot be a crisis next week.  My schedule is already full.
                -- Henry Kissinger

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Reply via email to