Browse Source

* fix for DelChar past end of line

pierre 25 years ago
parent
commit
1cdd21c0ff
1 changed files with 6 additions and 3 deletions
  1. 6 3
      ide/text/weditor.pas

+ 6 - 3
ide/text/weditor.pas

@@ -2648,11 +2648,11 @@ begin
   HoldUndo:=StoreUndo;
   HoldUndo:=StoreUndo;
   StoreUndo:=false;
   StoreUndo:=false;
   S:=GetLineText(CurPos.Y);
   S:=GetLineText(CurPos.Y);
-  if CurPos.X=length(S) then
+  if CurPos.X>=length(S) then
    begin
    begin
      if CurPos.Y<GetLineCount-1 then
      if CurPos.Y<GetLineCount-1 then
       begin
       begin
-        SetLineText(CurPos.Y,S+GetLineText(CurPos.Y+1));
+        SetLineText(CurPos.Y,S+CharStr(' ',CurPOS.X-Length(S))+GetLineText(CurPos.Y+1));
         StoreUndo:=HoldUndo;
         StoreUndo:=HoldUndo;
         SCP.X:=0;SCP.Y:=CurPos.Y+1;
         SCP.X:=0;SCP.Y:=CurPos.Y+1;
         AddAction(eaDeleteLine,SCP,CurPos,GetLineText(CurPos.Y+1));
         AddAction(eaDeleteLine,SCP,CurPos,GetLineText(CurPos.Y+1));
@@ -5613,7 +5613,10 @@ end;
 END.
 END.
 {
 {
   $Log$
   $Log$
-  Revision 1.80  2000-02-07 12:11:15  pierre
+  Revision 1.81  2000-02-09 12:56:54  pierre
+   * fix for DelChar past end of line
+
+  Revision 1.80  2000/02/07 12:11:15  pierre
    Gabors changes
    Gabors changes
 
 
   Revision 1.79  2000/02/05 14:50:59  florian
   Revision 1.79  2000/02/05 14:50:59  florian