[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vim-dev
Subject:    Re: Possible bug in syntax fold highlighting
From:       Noel Henson <noel () noels-lab ! com>
Date:       2002-11-17 21:41:08
[Download RAW message or body]

  Sorry, I forgot to reply to the mailing list instead of Bram directly.
Noel
------------------------------

Bram,

Thanks. I figured it was something like that.

I am trying to change the foldtext colors based on fold level. It is 
easy to do with syntax highlighting for unfolded sections. Is there a 
way I can do it for folded sections? Since the line, v:foldstart, is 
already the correct color, is there a way to inhibit the "highlight 
folded" colors?

What I'm looking for is this behavior (supposing of course that these 
options existed, which I know they don't)

hi folded foldlevel1 guifg=black
hi folded foldlevel2 guifg=red
hi folded foldlevel3 guifg=blue

So if I folded a section of a document at foldlevel==3 then its folded 
line color would be blue.

Noel
PS: I'm sure you've heard it many times before....  Great work on Vim. I 
love it!

Bram Moolenaar wrote:

>Noel Henson wrote:
>
>  
>
>>I have isolated a behavioral inconsistency in highlighting folds.
>>
>>Versions:
>>Vim 6.0.x - Vim 6.1
>>
>>I am using my own foldtext function and am, admittedly, using the "hi 
>>fold guifg=" setting in an unusual way. I am changing the "hi fold 
>>guifg" color on a line-by-line basis for folded lines. The function is 
>>behaving correctly and the guifg color is being set. The trouble is that 
>>the wrong color is being displayed for the folded line. As soon as 
>>redraw is executed, the display is redrawn with the correct colors. It 
>>looks as if the guifg value is not being updated when the value is set 
>>within the function but is updated at a later time; perhaps after the 
>>display is drawn.
>>
>>I have a .vim file and a data file that consistently exhibits the behavior.
>>
>>To whom do I address this and how do I procede?
>>    
>>
>
>Changing the highlighting halfway displaying text is not supported.  The
>results are unpredictable.  Vim does a lot of optimizations to avoid
>double work.  Even if you could manage to make it work with the current
>Vim, an optimization in a later version might break it again.
>
>--  
>Everybody lies, but it doesn't matter since nobody listens.
>                                -- Lieberman's Law
>
> ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
>///          Creator of Vim - Vi IMproved -- http://www.vim.org          \\\
>\\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
> \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///
>
>  
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic