When using indicators, I have noticed that even if the language has only
specified that it is using the 5 standard styling bits, when using
GETENDSTYLED, STARTSTYLING, and the proper masks for both indicator and
lexer styling, whenever the lexer passes over your 'indicator styled'
text, indicators are sometimes cleared.

Always using indicator #2 (bit 7) seems to work reasonably well, that is,
Python's lexer doesn't remove the indicators, the LaTeX lexer doesn't
lose all of its styling information, and obviously the null lexer always
works.  I read that the HTML lexer needs 7 of the 8 bits, so could only
work using indicator #2.  But anyways...

Is this by design (the clearing of bits that are beyond the styling mask),
a feature of the lexers I'm using (do all of them except for the null
lexer use more than 5 bits), or perhaps an artifact of using the
wxPython scintilla binding?


Generally, what I'm doing is the following...

    style = self.GetEndStyled()
    start, end = self.GetSelection()

    stc.StartStyling(start,wx.stc.STC_INDIC2_MASK)
    stc.SetStyling(end-start,wx.stc.STC_INDIC2_MASK)
    stc.IndicatorSetStyle(2, wx.stc.STC_INDIC_BOX)
    stc.IndicatorSetForeground(2, wx.RED)

    stc.StartStyling(end, wx.stc.STC_INDICS_MASK^0xff)


Using indicator #2 seems to always work, indicator #1 and #0 do strange
things to basically everything except the null lexer. I would like to
use all three indicators, but it seems as though most lexers use 7 of
the bits, even if they don't need them.  Am I misunderstanding something,
or is this expected behavior?

 - Josiah

_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to