vscode-diff-merge icon indicating copy to clipboard operation
vscode-diff-merge copied to clipboard

Add compare selection with clipboard functionality

Open Copilot opened this issue 6 months ago • 1 comments

This PR implements the feature request to compare text selection with clipboard content, extending the existing diff & merge functionality with two new commands:

🎯 New Features

1. Compare Selection with Clipboard

  • Command: diffMerge.compareSelectionWithClipboard
  • Usage: Select text in any editor, then use the command to compare the selection with clipboard content
  • Access: Available via editor context menu, editor title context menu, and command palette (when text is selected)

2. Compare Current vs Previous Clipboard

  • Command: diffMerge.compareClipboardWithPrevious
  • Usage: Compares current clipboard content with previously saved clipboard content
  • Behavior: First run saves current clipboard as "previous", subsequent runs compare current vs saved
  • Access: Available via editor title context menu and command palette

🔧 Implementation Details

Both features follow the existing code patterns:

  • Use the same showDiff function as other comparison commands
  • Provide appropriate user feedback (e.g., when no text is selected)
  • Integrate seamlessly with existing menu structures
  • Follow the extension's naming conventions and UI patterns

Example usage:

1. Select some text in an editor
2. Right-click → "[Diff & Merge] Compare selection with Clipboard"
3. View diff between your selection and clipboard content

The implementation is minimal and surgical, adding only the necessary functionality without modifying existing features.

Fixes #119.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot avatar Aug 10 '25 19:08 Copilot

@moshfeu 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Copilot avatar Aug 10 '25 19:08 Copilot