I'm trying to revise the source in screen.c to allow for showing
different fold highlighting depending on the level of a fold.
Currently there is one highlight group for all folded lines ("Fold" or
the HLF_FL tag in screen.c). Having highlighting that can vary
depending on the level gives better visual cues when using Vim for
highlighting.
I had a modification working that modified the source to add nine new
highlight flags for levels 2 through 10 (e.g., HLF_FL2, HLF_FL3,
HLF_FL4, HLF_FL5) and that works and was fairly straightforward. See
screenshot here:
http://www.plainspokenfinancial.com/screenshot.png
But a better solution would be to run a hl_combine_attr function on
HLF_FL and the current screen attributes. That way a user can
specify, e.g., 'hi Fold gui=bold guifg=NONE' and the folds will have
color of the highlighted region or match below, but show up as bold to
give a visual cue for the fold. This requires modification (I think)
of only one line in the code, and also makes it easier to add certain
functions I'm thinking of adding to the VimOutliner project.
I'm having trouble coming up with the correct combine attr's solution
and I'm wondering if someone can help. I've made a revision in the
line below, and it does indeed work to reveal highlighting of a region
below, but it REVEALS THE HIGHLIGHT OF THE LINE ABOVE THE FOLD, not
the highlight of the line immediately under the fold. I suspect this
is a with specify the offset in ScreenAttr[], but I can't figure out
what the corect offset should be.
Can someone offer some help?
Here's original line in screen.c:
*****************************
line 2173*** /* Set all attributes of the 'number' column and the
text */
line 2174*** RL_MEMSET(col, hl_attr(HLF_FL), W_WIDTH(wp) - col);
****************************
I've revised that line to be:
***********************************
RL_MEMSET(col, hl_combine_attr( ScreenAttrs[off + col ],
hl_attr(HLF_FL)),
W_WIDTH(wp) - col);
**********************************
As I said, that revision works so that highlight of the line above the
fold is revealed on the fold line when the fold highlight is set to
NONE (i.e., 'hl Fold gui=bold guifg=NONE).
I hoping there's something simple I'm missing about specifying the
ScreenAttrs[] offset. Any hints?
Thanks,
Herb Sitz
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---