2008/5/24 Jjgod Jiang <[EMAIL PROTECTED]>:
>
> Hi folks,
>
> Recently I observed a weird problem in vim-cocoa when doing syntax
> highlighting, however after some debugging, I discovered that's not
> related to the GUI code.
>
> The problem is, if a :highlight rule contains "gui=italic", then it
> will be interpreted as underline (HL_UNDERLINE) rather than italic,
> resulting the GUI part drawing underlined string instead of italic
> ones.
>
> The tricky thing is, I only observed this in vim-cocoa, MacVim doesn't
> have this problem -- but I could see the differences between their
> code in relevant part.
>
> vim-cocoa does load the highlight rule correctly, which can be
> confirmed by typing :highlight <rule-name>, it does show "gui=italic"
> just like MacVim, but then emitting strings for drawing in ui_write(),
> the attribute contains HL_UNDERLINE, that's the part I really can't
> find out why.
>
> Here are two screenshots to demonstrate this briefly (note the highlight
> of comment):
>
>   http://jjgod.org/document/images/vim-cocoa-highlight.png
>   http://jjgod.org/document/images/macvim-highlight.png
>
> So here I'm looking for further advices, is there any other
> configuration may affect this behavior? Thanks.

Hi Jiang,

This is a guess, but could it be that you need to add FEAT_GUI_COCOA
(?) to the following lines in gui.c (starting at line 2246)?  Note
that this is taken from the MacVim's gui.c so line numbers may differ
and obviously the FEAT_GUI_MACVIM isn't in the original gui.c.

Björn


#if defined(RISCOS) || defined(HAVE_GTK2) || defined(FEAT_GUI_MACVIM)
    /* If there's no italic font, then fake it.
     * For GTK2, we don't need a different font for italic style. */
    if (hl_mask_todo & HL_ITALIC)
        draw_flags |= DRAW_ITALIC;

    /* Do we underline the text? */
    if (hl_mask_todo & HL_UNDERLINE)
        draw_flags |= DRAW_UNDERL;
#else
    /* Do we underline the text? */
    if ((hl_mask_todo & HL_UNDERLINE)
# ifndef MSWIN16_FASTTEXT
            || (hl_mask_todo & HL_ITALIC)
# endif
       )
        draw_flags |= DRAW_UNDERL;
#endif

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

Raspunde prin e-mail lui