-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Copy to Clipboard to preserve visual structure of block selection #8579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The added tests make me super comfortable with this change. Thank you 😊
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
blocking per discussion earlier -- gotta think about this a bit 😄
Let's probably start with preserving whitespaces, but at least move forward with the line wraps? WDYT? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's try this on for size.
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: |
…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
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::GetText
that allows to apply formatting (includeCRLF / trimming)
to lines that were wrapped
Terminal::RetrieveSelectedTextFromBuffer
to apply the following parameters when block is selected:
that were wrapped
Validation Steps Performed
Closes #6740