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.
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.
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.
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.
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.
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. 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