Fix Copy to Clipboard to preserve visual structure of block selection#8579
Merged
1 commit merged intomicrosoft:mainfrom Dec 14, 2020
Merged
Conversation
Contributor
Author
carlos-zamora
approved these changes
Dec 14, 2020
Member
carlos-zamora
left a comment
There was a problem hiding this comment.
The added tests make me super comfortable with this change. Thank you 😊
DHowett
requested changes
Dec 14, 2020
Member
DHowett
left a comment
There was a problem hiding this comment.
blocking per discussion earlier -- gotta think about this a bit 😄
Contributor
Author
Let's probably start with preserving whitespaces, but at least move forward with the line wraps? WDYT? |
|
Hello @DHowett! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
🎉 Handy links: |
mpela81
pushed a commit
to mpela81/terminal
that referenced
this pull request
Jan 28, 2021
…microsoft#8579) There are two issue with copy to clipboard when block is selected: * We don't add new lines for lines that were wrapped * We remove trailing whitespaces which is not intuitive in block selection. Fixed the copy logic to always add newlines and not to remove whitespaces when block is selected. Even if shift is pressed! ## Detailed Description of the Pull Request / Additional comments * Added optional parameter to `TextBuffer::GetText` that allows to apply formatting (includeCRLF / trimming) to lines that were wrapped * Changed `Terminal::RetrieveSelectedTextFromBuffer` to apply the following parameters when block is selected: * includeCRLF = true * trimTrailingWhitespaces = false * apply the formatting above to all rows, including the ones that were wrapped ## Validation Steps Performed * Manual tests for both block and standard selection * Copy with both right-click and command * Added UT Closes microsoft#6740
This pull request was closed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

There are two issue with copy to clipboard when block is selected:
Fixed the copy logic to always add newlines and not to remove
whitespaces when block is selected.
Even if shift is pressed!
Detailed Description of the Pull Request / Additional comments
TextBuffer::GetTextthat allows to apply formatting (includeCRLF / trimming)
to lines that were wrapped
Terminal::RetrieveSelectedTextFromBufferto apply the following parameters when block is selected:
that were wrapped
Validation Steps Performed
Closes #6740