mirror of
https://github.com/doublecmd/doublecmd.git
synced 2026-06-21 09:58:13 +00:00
FIX: Don't copy last LineEnding when copy file names to clipboard
This commit is contained in:
parent
2f63e4f8df
commit
aab2d027f8
2 changed files with 19 additions and 1 deletions
|
|
@ -612,7 +612,7 @@ begin
|
|||
end;
|
||||
|
||||
Clipboard.Clear; // prevent multiple formats in Clipboard (specially synedit)
|
||||
Clipboard.AsText := sl.Text;
|
||||
Clipboard.AsText:= TrimRightLineEnding(sl.Text, sl.TextLineBreakStyle);
|
||||
end;
|
||||
|
||||
finally
|
||||
|
|
|
|||
|
|
@ -251,6 +251,12 @@ function RemoveQuotation(const Str: String): String;
|
|||
@param(CmdLine Command line)
|
||||
}
|
||||
procedure SplitArgs(var Args: TOpenStringArray; CmdLine: String);
|
||||
{en
|
||||
Remove last line ending in text
|
||||
@param(sText Text)
|
||||
@param(TextLineBreakStyle Text line break style)
|
||||
}
|
||||
function TrimRightLineEnding(const sText: UTF8String; TextLineBreakStyle: TTextLineBreakStyle): UTF8String;
|
||||
|
||||
procedure ParseLineToList(sLine: String; ssItems: TStrings);
|
||||
procedure InsertFirstItem(sLine: String; comboBox: TCustomComboBox);
|
||||
|
|
@ -894,6 +900,18 @@ begin
|
|||
end;
|
||||
end;
|
||||
|
||||
function TrimRightLineEnding(const sText: UTF8String;
|
||||
TextLineBreakStyle: TTextLineBreakStyle): UTF8String;
|
||||
const
|
||||
TextLineBreakArray: array[TTextLineBreakStyle] of Integer = (1, 2, 1);
|
||||
var
|
||||
I, L: Integer;
|
||||
begin
|
||||
L:= Length(sText);
|
||||
I:= TextLineBreakArray[TextLineBreakStyle];
|
||||
Result:= Copy(sText, 1, L - I); // Copy without last line ending
|
||||
end;
|
||||
|
||||
procedure ParseLineToList(sLine: String; ssItems: TStrings);
|
||||
var
|
||||
xPos: Integer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue