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

Possibility to edit file directly on diff

Open PixelT opened this issue 7 years ago β€’ 13 comments

When I'm using default vscode compare files options, I can edit the file on right directly on diff window / tab. Will be great if I can also edit file using your partial diff extension :)

PixelT avatar Aug 21 '18 10:08 PixelT

Hello @PixelT , thanks for your suggestion. It's interesting that you want to edit the text on diff (and reflect them back to the original text, I assume?) because I actually wanted the text to be locked in the diff view when I developed this extension πŸ˜„

But I'd like to consider changing the behaviour (though the change would be not too easy).

By the way, is there any specific use-case you have with the native editable diff view?

ryu1kn avatar Aug 21 '18 13:08 ryu1kn

For example: when I'm using CMS systems like Wordpress or Magento, it easier & faster to diff changes between my theme and default (parent) theme (if there was any changes or updates which I need or can add into my theme) and edit it directly in diff, because right now I must compare it with diff, then go to file, search place where the changes are and edit it manually in this file ;)

As I wrote, in default vsc diff it's possibility to edit one side :) Maybe a good option will be to add settings to set on / off possibility to edit on diff view?

PixelT avatar Aug 23 '18 07:08 PixelT

Thanks for the information! It’s always great to know the context so that i can understand how the current situation impacting you πŸ˜‰

ryu1kn avatar Aug 23 '18 08:08 ryu1kn

And yes, providing an option to choose editable or not, or a separate command can solve the dilemma.

ryu1kn avatar Aug 23 '18 08:08 ryu1kn

+100 for editing both panels, or one of them if the other one is the clipboard. WebStorm allows this, and it's incredibly helpful. Use cases:

  • Merge two arbitrary files
  • When editing long expected value of test cases, update the expected text with the output (copied from terminal to the clipboard) when necessary

dandv avatar Dec 06 '18 05:12 dandv

Thanks @dandv for your input. I really appreciate that you also provided the use cases!

ryu1kn avatar Dec 07 '18 12:12 ryu1kn

This may be slightly out of scope for this specific issue (or even for this project) but I'd really love to see full merge capabilities.

http://winmerge.org/ is a good example of what I'm looking for. I am not requesting every single feature from WinMerge be added here, but specifically the ability to merge left or right. Basically "make both files match for this diff using what is on the left or right".

nemchik avatar May 21 '19 14:05 nemchik

definitely a very heavy missing feature! Came across from PhpStorm and give VSCode a try. Was one of the first stuff I've searching for.

xstable avatar Jun 06 '20 12:06 xstable

definitely a very heavy missing feature! Came across from PhpStorm and give VSCode a try. Was one of the first stuff I've searching for.

Same here. Feels like a missing feature when coming from PHPStorm.

mkarulin avatar Oct 19 '20 07:10 mkarulin

Im not sure about how it merges in the clipboard case, but for the "Compare Text in Visible Editors", it can be achieved by changing the function/call to the same one as in VSCode Explorer (sidebar) 's "Select for Compare" + "Compare with Selected" .

irvnriir avatar Mar 04 '21 19:03 irvnriir

In addition to winmerge full merge use case referred above, a even more useful IMO feature would be partial merge exemplified by the following workflow:

  • Have some side-by-side file comparison.
  • Automatically scroll to first difference.
  • If changing of a file for that specific change is needed then merge it (to the right with shortcut Alt+Right, left with Alt+Left).
  • Scroll to next difference with shortcut Alt-Down.
  • When finished merging request rechecking the 2 files again (for potential typos and to see the updated differences , one might not want to have 2 exactly identical files, or have one based on the other).

peterwx avatar Oct 25 '21 11:10 peterwx

Still without this function, hard to use.

Li-Mingshuang avatar Aug 03 '23 16:08 Li-Mingshuang