Hi,

I recently noticed, that there are some problems with synIDattr()น:

1) the standout highlighting attribute is not mentioned at the help 
   file or at least not at :h synIDattr()

2) you cannot query the font attribute, although you can set it.
   I think this should be possible, since you can set it.

3) synIDattr() returns sometimes incorrect values. Try
   gvim -u NONE -c "echo synIDattr(synIDtrans(hlID('Normal')), 'fg',
   'cterm')" 
   This will return -1 though it should probably return an empty string,
   I guess. 

Attached patch fixes these problems (also available at
http://www.256bit.org/~chrisbra/patches/syIDattr.patch). You can now
query the font attribute using
    gvim -u NONE -c "echo synIDattr(synIDtrans(hlID('Normal')), 'font')" 

The usual disclaimer applies though: My C-Skills are rusty, so please
review carefully. I have tested this patch and it works for me on
Windows and Linux.

(BTW: could it be possible to have synIDattr() return a dictionary with
all available attributes for a highlighting group? It is very clumsy to
save the hi output without falling back to redir | hi in order to
restore it later.)


น) see this recent thread at vim_use:
http://groups.google.com/group/vim_use/browse_frm/thread/68373b7463ef2099#

regards,
Christian
-- 

-- 
You received this message from the "vim_dev" 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

Raspunde prin e-mail lui