Browse Source

Fix undo insert new line.

Margers 1 tháng trước cách đây
mục cha
commit
c14eff7c36
2 tập tin đã thay đổi với 3 bổ sung2 xóa
  1. 2 1
      packages/ide/wcedit.pas
  2. 1 1
      packages/ide/weditor.pas

+ 2 - 1
packages/ide/wcedit.pas

@@ -1412,7 +1412,8 @@ begin
                 SetCurPtr(EndPos.X,EndPos.Y);
                 Line:=Copy(GetDisplayText(StartPos.Y),1,StartPos.X);
                 If Length(Line)<StartPos.X then
-                  Line:=Line+CharStr(' ',StartPos.X-length(Line))+uText;
+                  Line:=Line+CharStr(' ',StartPos.X-length(Line))+uText
+                else Line:=Line+uText;
                 SetDisplayText(StartPos.Y,Line+Copy(GetDisplayText(EndPos.Y),EndPos.X+1,255));
                 SetMinMax(EndPos.Y);
                 SetCurPtr(0,EndPos.Y);

+ 1 - 1
packages/ide/weditor.pas

@@ -5246,8 +5246,8 @@ begin
 {      SelBack:=length(S)-SelEnd.X;}
       SetLineText(CurPos.Y,RTrim(S,not IsFlagSet(efUseTabCharacters)));
     end;
-    SetLineText(CurPos.Y,copy(S,1,CI-1));
     CalcIndent(CurPos.Y);
+    SetLineText(CurPos.Y,copy(S,1,CI-1));
     S:=copy(S,CI,Length(S));
     i:=1;
     while (i<=length(s)) and (i<=length(IndentStr)) and (s[i]=' ') do