Browse Source

Fix copy line with Tab char in it.

Margers 1 month ago
parent
commit
f4ed47545d
1 changed files with 8 additions and 3 deletions
  1. 8 3
      packages/ide/weditor.pas

+ 8 - 3
packages/ide/weditor.pas

@@ -3296,12 +3296,17 @@ begin
         LineStartX:=0;
 
       if (LineDelta=LineCount-1) or VerticalBlock then
-        LineEndX:=Editor^.SelEnd.X-1
+        begin
+          LineEndX:=Editor^.SelEnd.X-1;
+          CharIdxEnd:=Editor^.LinePosToCharIdx(Editor^.SelStart.Y+LineDelta,LineEndX);
+        end
       else
-        LineEndX:=Length(S);
+        begin
+          LineEndX:=Length(S);
+          CharIdxEnd:=LineEndX;
+        end;
 
       CharIdxStart:=Editor^.LinePosToCharIdx(Editor^.SelStart.Y+LineDelta,LineStartX);
-      CharIdxEnd:=Editor^.LinePosToCharIdx(Editor^.SelStart.Y+LineDelta,LineEndX);
       if LineEndX<LineStartX then
         S:=''
       else if VerticalBlock then