$jrsoftware: issrc/SynEdit-1.1-patch.txt,v 1.1 2005/03/09 23:14:47 jr Exp $

This patch to SynEdit 1.1 makes two changes:

1. It fixes several one-off bugs in the DoLinesDeleted calls.

2. It moves the Run field of TSynPasSyn from the "private" section
   to the "protected" section. SynHighlighterISXCode needs this.


Index: Source/SynEdit.pas
===================================================================
RCS file: /cvsroot/synedit/SynEdit/Source/SynEdit.pas,v
retrieving revision 1.139
diff -u -r1.139 SynEdit.pas
--- Source/SynEdit.pas	24 May 2002 08:52:18 -0000	1.139
+++ Source/SynEdit.pas	9 Mar 2005 20:05:31 -0000
@@ -5301,7 +5301,7 @@
           end;
           CaretXY := Item.ChangeStartPos;
           TrimmedSetLine(CaretY - 1, TmpStr + Item.ChangeStr);
-          DoLinesDeleted(CaretY, 1);
+          DoLinesDeleted(CaretY+1, 1);
         end;
       crIndent:
         begin
@@ -6100,7 +6100,7 @@
                   CaretY := CaretY - 1;
                   CaretX := Length(Lines[CaretY - 1]) + 1;
                   Lines.Delete(CaretY);
-                  DoLinesDeleted(CaretY, 1);
+                  DoLinesDeleted(CaretY+1, 1);
                   if eoTrimTrailingSpaces in Options then
                     Temp := TrimTrailingSpaces(Temp);
                   LineText := LineText + Temp;
@@ -6230,7 +6230,7 @@
                 Caret := Point(1, CaretY + 1);
                 Helper := #13#10;
                 Lines.Delete(CaretY);
-                DoLinesDeleted(CaretY - 1, 1);
+                DoLinesDeleted(CaretY+1, 1);
               end;
             end;
             if (Caret.X <> CaretX) or (Caret.Y <> CaretY) then begin
@@ -6324,7 +6324,7 @@
 {end}                                                                           //Fiala
             Lines.Delete(CaretY - 1);
           end;
-          DoLinesDeleted(CaretY - 1, 1);
+          DoLinesDeleted(CaretY, 1);
           CaretXY := Point(1, CaretY); // like seen in the Delphi editor
         end;
       ecClearAll:
Index: Source/SynHighlighterPas.pas
===================================================================
RCS file: /cvsroot/synedit/SynEdit/Source/SynHighlighterPas.pas,v
retrieving revision 1.17
diff -u -r1.17 SynHighlighterPas.pas
--- Source/SynHighlighterPas.pas	8 Apr 2002 08:38:14 -0000	1.17
+++ Source/SynHighlighterPas.pas	9 Mar 2005 20:05:31 -0000
@@ -94,7 +94,6 @@
     fLine: PChar;
     fLineNumber: Integer;
     fProcTable: array[#0..#255] of TProcTableProc;
-    Run: LongInt;
     fStringLen: Integer;
     fToIdent: PChar;
     fIdentFuncTable: array[0..191] of TIdentFuncTableFunc;
@@ -216,6 +215,7 @@
     procedure SetDelphiVersion(const Value: TDelphiVersion);                    //pp 2001-08-14
     procedure SetPackageSource(const Value: Boolean);                           //pp 2001-08-14
   protected
+    Run: LongInt;
     function GetIdentChars: TSynIdentChars; override;
     function GetSampleSource: string; override;                                 //pp 2001-08-13
     function IsFilterStored: boolean; override;                                 //mh 2000-10-08
