Skip to content
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

Avoid generating extra formatted copies when no action specific copyFormatting is set #16480

Merged

Conversation

tusharsnx
Copy link
Contributor

@tusharsnx tusharsnx commented Dec 17, 2023

Avoid generating extra formatted copies when action's copyFormatting is not present and globally set copyFormatting is used.

Previously, when the action's copyFormatting wasn't set we deferred the decision of which formats needed to be copied to the TerminalPage::CopyToClipboard handler. This meant we needed to copy the text in all the available formats and pass it to the handler to copy the required formats after querying the global copyFormatting.

To avoid making extra copies, we'll store the global copyFormatting in TerminalSettings and pass it down to TermControl. If ControlCore::CopySelectionToClipboard() doesn't receive action specific copyFormatting, it will fall back to the global one before generating the texts.

Validation Steps Performed

  • no copyFormatting set for the copy action: Copies formats according to the global copyFormatting.
  • copyFormatting is set for the copy action: Copies formats according to the action's copyFormatting.

@zadjii-msft zadjii-msft added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jan 24, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot merged commit da182e6 into microsoft:main Jan 24, 2024
15 checks passed
Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for doing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants