Jiri,
I have pasted the questions and Neils answers below with my comments
and I'm sure others may have more info.
> Jiří Techet:
>
> > I have a question regarding the use of SCI_COLOURISE. It is used in Geany at several places and it's call is rather expensive so I'd like to avoid it as much as possible.
>
> Most of the time all of the buffer you see should be styled automatically by Scintilla in a lazy way. That means that Scintilla does not normally style much beyond the portion currently visible. There are times when you want the whole file to be styled, such as when exporting the file as HTML/PDF/RTF. There may also be workarounds to problems in Scintilla and its possible some of these workarounds are no longer needed.
>
> > 1. After SCI_SETKEYWORDS - this basically happens after every keystroke because we colorize typenames using keywords (we've already talked about that if you remember).
>
> Possibly Geany wants the document styled up to some point immediately so it can use the style information.
As best I can tell this one is extraneous, it would just change names
from/to type colourising which AFAICT doesn't affect anything else,
they are both code type styles etc. So long as the visible area is
colorised by Scintilla so when a newly typed name matches a keyword it
will highlight, then it doesn't look like doing it manually is useful.
>
> > 2. Immediately after SCI_SETTEXT when loading (or reloading) file.
>
> This may or may not be needed depending on Geany’s features. One reason for doing this is if you want to perform a global fold operation since folding depends on fold information and thus on styling.
This one is more likely useful, since lots of features need to know
the styles of things outside the visible area, for example to avoid
considering characters in comments and strings when counting braces
for scopes.