Using wx.stc.STC_INDIC1_MASK clear not visible styling

I'm having problems when trying to use wx.stc indicators.
The current visible text is correctly styled, but the remaining text not.
That is, when scrolled the window, the text has lost his python style.

I'm using:

style = stc.STC_INDIC1_MASK
self.StartStyling(start, style)
self.SetStyling(lenght, style)

You can see the full source of
EditorCtrl(wx.stc.StyledTextCtrl).HighlightText at:

http://code.google.com/p/rad2py/source/browse/ide2py/editor.py#959

Anyone have any advice about this?
I guess I'm doing some step wrongly or out of order, but I cannot
figure how to do it right.

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com

Sorry, I forgot to link to an example image.

A ticket with a screenshot is at:

http://code.google.com/p/rad2py/issues/detail?id=11

Clarification: with "not visible styling" I mean text not currently shown.

Regards

Mariano Reingart
http://www.sistemasagiles.com.ar

···

On Tue, Feb 14, 2012 at 5:41 PM, Mariano Reingart <reingart@gmail.com> wrote:

I'm having problems when trying to use wx.stc indicators.
The current visible text is correctly styled, but the remaining text not.
That is, when scrolled the window, the text has lost his python style.

I'm using:

style = stc.STC_INDIC1_MASK
self.StartStyling(start, style)
self.SetStyling(lenght, style)

You can see the full source of
EditorCtrl(wx.stc.StyledTextCtrl).HighlightText at:

Google Code Archive - Long-term storage for Google Code Project Hosting.

Anyone have any advice about this?
I guess I'm doing some step wrongly or out of order, but I cannot
figure how to do it right.

Best regards

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com

My guess is that Scintilla is assuming that the text from start to start+length has been already been styled and so it is not calling the lexer for that part of the text. Usually the styling of text not yet visible is deferred until that text becomes visible, so if you are styling beyond the visible portion then that could confuse things. Folks who have actually used wxSTC may have a better answer for you and/or suggestions. I haven't done much with it myself beyond the samples.

···

On 2/14/12 12:41 PM, Mariano Reingart wrote:

I'm having problems when trying to use wx.stc indicators.
The current visible text is correctly styled, but the remaining text not.
That is, when scrolled the window, the text has lost his python style.

I'm using:

style = stc.STC_INDIC1_MASK
self.StartStyling(start, style)
self.SetStyling(lenght, style)

You can see the full source of
EditorCtrl(wx.stc.StyledTextCtrl).HighlightText at:

Google Code Archive - Long-term storage for Google Code Project Hosting.

Anyone have any advice about this?
I guess I'm doing some step wrongly or out of order, but I cannot
figure how to do it right.

--
Robin Dunn
Software Craftsman

Thanks Robin, you're right, if I scroll down the text previously, it
gets correctly highlighted.
The question now is how to force the lexer to not defer styling, or
how to manually call the lexer in advance to avoid this issue.

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar

···

On Tue, Feb 14, 2012 at 6:04 PM, Robin Dunn <robin@alldunn.com> wrote:

My guess is that Scintilla is assuming that the text from start to
start+length has been already been styled and so it is not calling the lexer
for that part of the text. Usually the styling of text not yet visible is
deferred until that text becomes visible, so if you are styling beyond the
visible portion then that could confuse things. Folks who have actually used
wxSTC may have a better answer for you and/or suggestions. I haven't done
much with it myself beyond the samples.

self.Colourise(0, self.GetLength()) fixed the issue, forcing the lexer
to style the text not visible yet

self is the wx.stc.StyledTextControl subclass, for full details see:

http://code.google.com/p/rad2py/source/detail?r=5a7226c6295b9ed7deec7323a326ce7c3b39f105

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar

···

On Tue, Feb 14, 2012 at 6:14 PM, Mariano Reingart <reingart@gmail.com> wrote:

On Tue, Feb 14, 2012 at 6:04 PM, Robin Dunn <robin@alldunn.com> wrote:

My guess is that Scintilla is assuming that the text from start to
start+length has been already been styled and so it is not calling the lexer
for that part of the text. Usually the styling of text not yet visible is
deferred until that text becomes visible, so if you are styling beyond the
visible portion then that could confuse things. Folks who have actually used
wxSTC may have a better answer for you and/or suggestions. I haven't done
much with it myself beyond the samples.

Thanks Robin, you're right, if I scroll down the text previously, it
gets correctly highlighted.
The question now is how to force the lexer to not defer styling, or
how to manually call the lexer in advance to avoid this issue.

Oh yeah, I think I knew that. :wink: Thanks for following up with that info.

···

On 2/14/12 4:02 PM, Mariano Reingart wrote:

On Tue, Feb 14, 2012 at 6:14 PM, Mariano Reingart<reingart@gmail.com> wrote:

On Tue, Feb 14, 2012 at 6:04 PM, Robin Dunn<robin@alldunn.com> wrote:

My guess is that Scintilla is assuming that the text from start to
start+length has been already been styled and so it is not calling the lexer
for that part of the text. Usually the styling of text not yet visible is
deferred until that text becomes visible, so if you are styling beyond the
visible portion then that could confuse things. Folks who have actually used
wxSTC may have a better answer for you and/or suggestions. I haven't done
much with it myself beyond the samples.

Thanks Robin, you're right, if I scroll down the text previously, it
gets correctly highlighted.
The question now is how to force the lexer to not defer styling, or
how to manually call the lexer in advance to avoid this issue.

self.Colourise(0, self.GetLength()) fixed the issue, forcing the lexer
to style the text not visible yet

--
Robin Dunn
Software Craftsman