<div dir="ltr"><br><div class="gmail_extra">On Fri, Jun 26, 2015 at 11:40 AM, Lex Trotman <span dir="ltr"><<a href="mailto:elextr@gmail.com" target="_blank">elextr@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Jiri,<br>
<br>
I have pasted the questions and Neils answers below with my comments<br>
and I'm sure others may have more info.<br>
<br>
> Jiří Techet:<br>
><br>
> > 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.<br>
><br>
>     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.<br>
><br>
> > 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).<br>
><br>
>    Possibly Geany wants the document styled up to some point immediately so it can use the style information.<br>
<br>
As best I can tell this one is extraneous, it would just change names<br>
from/to type colourising which AFAICT doesn't affect anything else,<br>
they are both code type styles etc.  So long as the visible area is<br>
colorised by Scintilla so when a newly typed name matches a keyword it<br>
will highlight, then it doesn't look like doing it manually is useful.<br></blockquote><div><br></div><div>This is the main use of SCI_SETTEXT I was interested in and yes, I also think this one can be (safely) removed. It isn't called already by languages not highlighting typenames like e.g. python so there's very little risk that anything breaks by removing it because it would have already been broken for all the scripting languages.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
><br>
> > 2. Immediately after SCI_SETTEXT when loading (or reloading) file.<br>
><br>
>    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.<br>
<br>
This one is more likely useful, since lots of features need to know<br>
the styles of things outside the visible area, for example to avoid<br>
considering characters in comments and strings when counting braces<br>
for scopes.<br></blockquote><div><br></div><div>Yes, this one should probably stay. But I would delay it's call until the document is actually shown to improve Geany start time with many tabs open.</div><div><br></div><div>For completeness, there was also another case in my original email:</div><div><br></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">3. When reloading configuration files which can change various aspects of Scintilla (keywords, style coloring, etc.)</span><br></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">but since this one is called only when changing config files, it's not worth worrying about.</span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">(plus one more use in </span>brace_match() but it's a single-character one and doesn't matter either<span style="font-family:Arial,Helvetica,sans-serif;font-size:13px">)</span></div><div><br></div><div>Cheers,</div><div><br></div><div>Jiri</div></div></div></div>