View previous topic :: View next topic |
Author |
Message |
mstaszew
Joined: 21 Jul 2006 Posts: 67 Location: North Carolina, USA
|
Posted: Tue Aug 22, 2006 7:52 pm Post subject: Question about the disable full refresh option |
|
|
There is an option on the Common tab of the lexer customization window labeled... "Disable full refresh if text length is greater than <some integer>"
What exactly is this supposed to do? I would assume that it would not show collapsible regions and not perform parsing as characters are entered. I set it to something really small like 5 just to test and I always see collapsible ranges. The code here...
Code: | procedure TClientSyntAnalyzer.ChangedAtPos(APos: integer);
...
begin
if FSrcProc.TextLength <= Owner.FullRefreshSize then
begin
Clear;
Exit;
end;
... |
Seems like the <= should be a >= (or just >), but even when I made that change locally, the refresh still appears to have happened. Am I misunderstanding the option or is there a bug here somewhere?
Thanks. |
|
Back to top |
|
|
econtrol Site Admin
Joined: 09 Jun 2006 Posts: 202
|
Posted: Wed Aug 23, 2006 10:40 am Post subject: |
|
|
Visually this option has no effect.
It means that if text length less then FullRefreshSize text will be fully reparsed after any editing.
Otherwise only text after editing position will be reparsed.
It is intended for those cases when it is required to use not "stable" regular expressions.
For example, highlighting Pascal multi-line comment may be written as:
Rule 1. (?s)\{.*?\}
When user input only '{' => there is no highlighting
Rule 2. (?s)\{.*?(\}|\Z)
When user input only '{' => all text after this position highlighted as comment.
There is one problem in lexer results refreshing for "Rule 1":
After input of '}' text will not be highlighted. FullRefreshSize is intended for correct handling of such rules.
FullRefreshSize make worse analysis performance. It should be used only if you are going to use rules like "Rule 1".
By default, this option is 0.
Suggestion: avoid using rules like "Rule 1" and do not use FullRefreshSize.
If you set FullRefreshSize to big value (for example, 1000000) editing of big files will be very slow.
Michael. |
|
Back to top |
|
|
|