//热键 ctrl+L
program DuplicateLine;
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Clipbrd;
var
Lines: TStringList;
Clipboard: TClipboard;
i: Integer;
begin
Lines := TStringList.Create;
Clipboard := TClipboard.Create;
try
if IdeGetEditorSelectedLines(Lines) then
begin
Clipboard.Clear;
Clipboard.AsText := Lines.Text;
end;
if Clipboard.HasFormat(1) then
begin
// if IdeGetEditorSelectedLines(Lines) then
// begin
// IdeSetEditorSelectedLines(Lines);
// end;
if IdeGetEditorSelectedLines(Lines) then
begin
Lines.Text := Clipboard.AsText + Lines.Text;
IdeSetEditorSelectedLines(Lines);
end;