mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-22 10:55:00 +00:00
fix: Prevent extra newlines when copy lines
This commit is contained in:
parent
5301a368e0
commit
dbceb5b6c0
1 changed files with 11 additions and 8 deletions
|
@ -1034,17 +1034,20 @@ namespace SourceGit.Views
|
||||||
|
|
||||||
if (i == startIdx && startPosition.Column > 1)
|
if (i == startIdx && startPosition.Column > 1)
|
||||||
{
|
{
|
||||||
builder.AppendLine(line.Content.Substring(startPosition.Column - 1));
|
builder.Append(line.Content.Substring(startPosition.Column - 1));
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
|
else if (i == endIdx && endPosition.Column < line.Content.Length)
|
||||||
if (i == endIdx && endPosition.Column < line.Content.Length)
|
|
||||||
{
|
{
|
||||||
builder.AppendLine(line.Content.Substring(0, endPosition.Column - 1));
|
if (builder.Length > 0)
|
||||||
continue;
|
builder.AppendLine();
|
||||||
|
builder.Append(line.Content.Substring(0, endPosition.Column - 1));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (builder.Length > 0)
|
||||||
|
builder.AppendLine();
|
||||||
|
builder.Append(line.Content);
|
||||||
}
|
}
|
||||||
|
|
||||||
builder.AppendLine(line.Content);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
App.CopyText(builder.ToString());
|
App.CopyText(builder.ToString());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue