Diff parts of 2 files

Answered

Is it possible to diff only parts of files? i.e., I want to diff lines 50-150 of file 1 with lines 84-218 of file 2.  The other lines in the files would be excluded from the diff viewer.

I know that I can diff selected lines of a file against the clipboard, but I want to diff the selected lines against selected lines from another file.

If it's not currently possible, is there an open feature request for it on YouTrack?

0
5 comments
You can select that part and copy it to clipboard. Then open the comparation target file and select the corresponding part and click the "compare with clipboard" from the context menu. Does it work for you?
0

I already know about that. I want my changes to be written back to the other file immediately. I don't want to possibly accidentally lose my changes before I can copy & paste back to the other file, and I don't want to accidentally copy & paste incorrectly.

0
There's a `Collapse Unchanged Fragments` button on the diff window. Does it help?

I don't see any related feature request in YouTrack. Please feel free to create a requests in: https://youtrack.jetbrains.com/issues/IDEA
0

I want this feature specifically because other parts of the file have been changed. Those changes caused the diff viewer to diff the parts of the two files to be compared against some other text in the respective other file. I want to limit the lines differed to tell the differ that these are the specific lines I want compared against each other

0
Thank you for the clarificatioin. I've opened a feature request in https://youtrack.jetbrains.com/issue/IDEA-327085/Allow-users-to-select-lines-to-compare-with .

Feel free to watch the YouTrack item in order to be notified once it has updates. See [this article](https://intellij-support.jetbrains.com/hc/articles/207241135) if you are not familiar with YouTrack.
0

Please sign in to leave a comment.