Skip to content

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

Merged
microsoft-github-policy-service[bot] merged 2 commits intomicrosoft:mainfrom
tusharsnx:extra-copy-format-fix
Jan 24, 2024
Merged

Avoid generating extra formatted copies when no action specific copyFormatting is set#16480
microsoft-github-policy-service[bot] merged 2 commits intomicrosoft:mainfrom
tusharsnx:extra-copy-format-fix

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
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!

@tusharsnx tusharsnx deleted the extra-copy-format-fix branch January 25, 2024 08:05
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