Browse Source

* get correct position in indicator again

pierre 25 years ago
parent
commit
edcf10f5c2
2 changed files with 19 additions and 4 deletions
  1. 7 1
      ide/text/wcedit.pas
  2. 12 3
      ide/text/weditor.pas

+ 7 - 1
ide/text/wcedit.pas

@@ -150,6 +150,7 @@ type
     public
       procedure   UpdateIndicator; virtual;
       procedure   ModifiedChanged; virtual;
+      procedure   PositionChanged; virtual;
       procedure   LimitsChanged; virtual;
       function    IsClipboard: Boolean; virtual;
       function    LoadFromStream(Stream: PStream): boolean; virtual;
@@ -1099,6 +1100,11 @@ begin
   UpdateIndicator;
 end;
 
+procedure TCodeEditor.PositionChanged;
+begin
+  UpdateIndicator;
+end;
+
 procedure TCodeEditor.JumpToLastCursorPos;
 {$ifdef Undo}
 var
@@ -1177,7 +1183,7 @@ begin
             eaDeleteLine :
               begin
                 SetCurPtr(EndPos.X,EndPos.Y);
-                DelEnd;
+                {DelEnd;wrong for eaCut at least }
                 InsertNewLine;
                 SetCurPtr(StartPos.X,StartPos.Y);
                 SetLineText(StartPos.Y,GetStr(Text));

+ 12 - 3
ide/text/weditor.pas

@@ -463,6 +463,7 @@ type
       procedure   ContentsChanged; virtual;
       procedure   LimitsChanged; virtual;
       procedure   ModifiedChanged; virtual;
+      procedure   PositionChanged; virtual;
       procedure   TabSizeChanged; virtual;
       procedure   SyntaxStateChanged; virtual;
       procedure   StoreUndoChanged; virtual;
@@ -2610,6 +2611,11 @@ begin
   { Abstract }
 end;
 
+procedure TCustomCodeEditor.PositionChanged;
+begin
+  { Abstract }
+end;
+
 procedure TCustomCodeEditor.TabSizeChanged;
 begin
   { Abstract }
@@ -4934,8 +4940,8 @@ begin
     SetHighlightRow(-1);}
   if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) then
     AddAction(eaMoveCursor,OldPos,CurPos,'');
-{  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) then
-    UpdateIndicator;}
+  if ((CurPos.X<>OldPos.X) or (CurPos.Y<>OldPos.Y)) then
+    PositionChanged;{UpdateIndicator;}
   UnLock;
 end;
 
@@ -5581,7 +5587,10 @@ end;
 END.
 {
   $Log$
-  Revision 1.85  2000-03-21 23:17:47  pierre
+  Revision 1.86  2000-03-23 21:36:19  pierre
+   * get correct position in indicator again
+
+  Revision 1.85  2000/03/21 23:17:47  pierre
     + Gabor patch to add support for multiple windows
       of same file
       weditor has been splitted into weditor and wcedit units