mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-01-13 17:23:02 -05:00
Add an option for copying with trailing line break in STS (#2122)
This commit is contained in:
@@ -27,6 +27,11 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution.Contracts
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public bool RemoveNewLines { get; set; }
|
public bool RemoveNewLines { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Whether to avoid adding a line break between rows during row concatenation for copying result when the previous row already has a trailing line break.
|
||||||
|
/// </summary>
|
||||||
|
public bool AvoidNewLineAfterTailingLineBreak { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whether to include the column headers.
|
/// Whether to include the column headers.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -789,7 +789,7 @@ namespace Microsoft.SqlTools.ServiceLayer.QueryExecution
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Add line break if this is not the last row in all selections.
|
// Add line break if this is not the last row in all selections.
|
||||||
if (rowIndex + pageStartRowIndex != lastRowIndex)
|
if (rowIndex + pageStartRowIndex != lastRowIndex && (!builder.ToString().EndsWith(Environment.NewLine) || !requestParams.AvoidNewLineAfterTailingLineBreak))
|
||||||
{
|
{
|
||||||
builder.Append(Environment.NewLine);
|
builder.Append(Environment.NewLine);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user