浏览代码

Fix copy line with Tab char in it.

Margers 3 月之前
父节点
当前提交
f4ed47545d
共有 1 个文件被更改,包括 8 次插入3 次删除
  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