EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Question about the disable full refresh option

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Tue Aug 22, 2006 7:52 pm    Post subject: Question about the disable full refresh option Reply with quote

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
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Wed Aug 23, 2006 10:40 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group