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 

Prevent Autocorrection in Strings/Comments

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



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Tue Sep 26, 2006 10:04 pm    Post subject: Prevent Autocorrection in Strings/Comments Reply with quote

Hi Michael,

is it possible to prevent the autocorrection inside comments/strings?

If yes, how, if no, should i create a mantis entry?

Greetings
Jens
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Sun Oct 08, 2006 4:13 pm    Post subject: Reply with quote

Hello,

New syntax of OnAutoReplace:
Code:
 TOnAutoReplaceEvent = procedure(APos: integer; const AWord, AReplace: string; var Accept: Boolean) of object;


It will allow to control autocorrection.

Michael.
Back to top
View user's profile Send private message Send e-mail
jfudickar



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Mon Oct 09, 2006 7:06 am    Post subject: Reply with quote

So i then only need to check if the current position is inside a string or inside a comment.

Did you have codesample for this?

Greetings
Jens

P.S: Thanks for the change
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Wed Oct 11, 2006 9:29 am    Post subject: Reply with quote

Example:

Code:
procedure TForm4.SyntAutoReplace1AutoReplace(APos: Integer; const AWord,
  AReplace: String; var Accept: Boolean);
var idx: integer;
begin
  with SyntaxMemo1.SyntObj do
    begin
      idx := TokenAtPos(APos);
      Accept := (idx = -1) or (Tags[idx].TokenType <> 1{comment});
    end;
end;


P.S. It will be available in 2.27.

Michael.
Back to top
View user's profile Send private message Send e-mail
jfudickar



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Wed Oct 11, 2006 9:36 am    Post subject: Reply with quote

What is the best way for finding the "comment constant 1"?

Greetings
Jens
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Thu Oct 12, 2006 4:36 am    Post subject: Reply with quote

I.e. to find text?
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