ZIm/crates/git_ui/src
Joseph T. Lyons 500ceaabcd
Add an editor: diff clipboard with selection action (#33283)
https://github.com/user-attachments/assets/d472fbdd-7736-4bd7-8a90-8cca356b2815

This PR adds `editor: diff clipboard with selection` - good for spotting
the differences in eerily-similar code, which is when refactoring code,
as you need to see what needs to be passed in in order to maintain
previous behavior of both snippets.

1. Copy some text from anywhere
2. Highlight some text in Zed
3. Run `editor: diff clipboard with selection`

Like JetBrains' IDEs and VS Code with the `PartialDiff` package, if the
selection is empty, we take the entire buffer as the selection.

Caveats:

- We do not know the language of the text in the clipboard. I went ahead
and just assumed that in most cases, it will be the same language as the
selected text, which does mean we will highlight the old text
incorrectly if they are copying from a different language, but I think
in most cases, it will be the same, and the alternative of always having
no syntax highlighting is worse. PyCharm seems to do the same thing.

Release Notes:

- Added an `editor: diff clipboard with selection` action

---------

Co-authored-by: Junkui Zhang <364772080@qq.com>
Co-authored-by: Ben Kunkle <ben@zed.dev>
2025-07-23 02:39:32 +00:00
..
askpass_modal.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
blame_ui.rs editor: Move blame popover from hover_tooltip to editor prepaint (#29320) 2025-04-25 01:52:24 +05:30
branch_picker.rs Prevent branch name overflow in git panel selection (#33529) 2025-06-27 20:50:53 -03:00
commit_message_prompt.txt git_ui: Try to prompt the model out of including the diff output (#26281) 2025-03-07 15:05:35 +00:00
commit_modal.rs Add setting to disable all AI features (#34896) 2025-07-22 11:32:39 -04:00
commit_tooltip.rs editor: Move blame popover from hover_tooltip to editor prepaint (#29320) 2025-04-25 01:52:24 +05:30
commit_view.rs Remove into SelectionEffects from .change_selections (#33554) 2025-06-27 14:31:31 -06:00
conflict_view.rs editor: Improve minimap performance (#33067) 2025-07-15 00:29:27 +03:00
file_diff_view.rs Add an editor: diff clipboard with selection action (#33283) 2025-07-23 02:39:32 +00:00
git_panel.rs Add setting to disable all AI features (#34896) 2025-07-22 11:32:39 -04:00
git_panel_settings.rs git_ui: Add collapse_untracked_diff settings to improve usability for untracked files (#32591) 2025-06-22 00:38:24 +03:00
git_ui.rs Add an editor: diff clipboard with selection action (#33283) 2025-07-23 02:39:32 +00:00
onboarding.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
picker_prompt.rs editor: Improve code completion filtering to provide fewer and more accurate suggestions (#32928) 2025-06-18 16:01:28 +05:30
project_diff.rs gpui: Store action documentation (#33809) 2025-07-02 21:14:33 -04:00
remote_output.rs git_ui: Support "Open Pull Request" for more platforms (#33833) 2025-07-09 19:09:59 +00:00
repository_selector.rs Add language server control tool into the status bar (#32490) 2025-06-25 19:57:28 +03:00
text_diff_view.rs Add an editor: diff clipboard with selection action (#33283) 2025-07-23 02:39:32 +00:00