Skip to content

Commit

Permalink
Comment tweaks.
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnlaan committed Oct 11, 2024
1 parent a959c5a commit c8718fe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Projects/Src/IDE.MainForm.pas
Original file line number Diff line number Diff line change
Expand Up @@ -2910,9 +2910,9 @@ function TMainForm.MultipleSelectionPaste(const AMemo: TIDEScintEdit): Boolean;
begin
{ Scintilla doesn't yet properly support multiple selection paste. Handle it
here, VSCode style: if there's multiple selections and the paste text has the
same amount of lines then paste 1 line per selection. Otherwise do nothing
to allow Scintilla's default behaviour (which is to paste all lines into
each selection if SC_MULTIPASTE_EACH is on). }
same amount of lines then paste 1 line per selection. Otherwise paste all lines
into each selection. For the latter we don't need handling here: this is
Scintilla's default behaviour if SC_MULTIPASTE_EACH is on. }
Result := False;
var SelectionCount := AMemo.SelectionCount;
if SelectionCount > 1 then begin
Expand All @@ -2925,8 +2925,8 @@ function TMainForm.MultipleSelectionPaste(const AMemo: TIDEScintEdit): Boolean;
var EndPos := AMemo.SelectionEndPosition[I];
AMemo.ReplaceTextRange(StartPos, EndPos, PasteText[I], srmMinimal);
{ Update the selection to an empty selection at the end of the inserted
text, just like SCI_REPLACESEL }
var Pos := AMemo.Target.EndPos; { SCI_REPLACETARGET* updates the target }
text, just like ReplaceMainSelText }
var Pos := AMemo.Target.EndPos; { ReplaceTextRange updates the target }
AMemo.SelectionCaretPosition[I] := Pos;
AMemo.SelectionAnchorPosition[I] := Pos;
end;
Expand Down

0 comments on commit c8718fe

Please sign in to comment.