mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-02 21:07:35 +01:00
Fixed ecMoveLineUp/Down, ecDuplicateLine for persistent selection
git-svn-id: trunk@62573 -
This commit is contained in:
parent
0c33b3e2c7
commit
bbf0971c60
@ -7156,8 +7156,14 @@ begin
|
||||
end;
|
||||
ecMoveLineUp:
|
||||
if (not ReadOnly) then begin
|
||||
CY := BlockBegin.y;
|
||||
if FBlockSelection.SelAvail then
|
||||
CY := BlockBegin.Y
|
||||
else
|
||||
CY := FCaret.LinePos;
|
||||
if CY > 1 then begin
|
||||
InternalBeginUndoBlock;
|
||||
if not FBlockSelection.SelAvail then
|
||||
FBlockSelection.Clear;
|
||||
FBlockSelection.IncPersistentLock(sbpWeak);
|
||||
if SelAvail and (BlockEnd.x = 1) then
|
||||
FTheLinesView.EditLinesInsert(BlockEnd.y, 1, FTheLinesView[ToIdx(CY) - 1])
|
||||
@ -7167,24 +7173,36 @@ begin
|
||||
FTheLinesView.EditLinesDelete(CY - 1, 1);
|
||||
FCaret.DecAutoMoveOnEdit;
|
||||
FBlockSelection.DecPersistentLock;
|
||||
InternalEndUndoBlock;
|
||||
end;
|
||||
end;
|
||||
ecMoveLineDown:
|
||||
if (not ReadOnly) then begin
|
||||
CY := BlockEnd.y;
|
||||
if SelAvail and (BlockEnd.x = 1) then
|
||||
Dec(CY);
|
||||
if FBlockSelection.SelAvail then begin
|
||||
CY := BlockBegin.Y;
|
||||
if (BlockEnd.x = 1) then
|
||||
Dec(CY);
|
||||
end
|
||||
else
|
||||
CY := FCaret.LinePos;
|
||||
if CY < FTheLinesView.Count - 1 then begin
|
||||
InternalBeginUndoBlock;
|
||||
if not FBlockSelection.SelAvail then
|
||||
FBlockSelection.Clear;
|
||||
FBlockSelection.IncPersistentLock(sbpWeak);
|
||||
FCaret.IncAutoMoveOnEdit;
|
||||
FTheLinesView.EditLinesInsert(BlockBegin.y, 1, FTheLinesView[ToIdx(CY) + 1]);
|
||||
FTheLinesView.EditLinesDelete(CY + 2, 1);
|
||||
FCaret.DecAutoMoveOnEdit;
|
||||
FBlockSelection.DecPersistentLock;
|
||||
InternalEndUndoBlock;
|
||||
end;
|
||||
end;
|
||||
ecDuplicateLine:
|
||||
if (not ReadOnly) then begin
|
||||
InternalBeginUndoBlock;
|
||||
if not FBlockSelection.SelAvail then
|
||||
FBlockSelection.Clear;
|
||||
FBlockSelection.IncPersistentLock(sbpWeak);
|
||||
FInternalBlockSelection.AssignFrom(FBlockSelection);
|
||||
if FInternalBlockSelection.IsBackwardSel then begin
|
||||
@ -7202,6 +7220,7 @@ begin
|
||||
FInternalBlockSelection.StartLineBytePos := Point(1, FInternalBlockSelection.LastLineBytePos.y+1);
|
||||
FInternalBlockSelection.SelText := Temp;
|
||||
FBlockSelection.DecPersistentLock;
|
||||
InternalEndUndoBlock;
|
||||
end;
|
||||
ecScrollUp:
|
||||
begin
|
||||
|
||||
Loading…
Reference in New Issue
Block a user