MightyCreak / diffuse

Diffuse is a graphical tool for comparing and merging text files. It can retrieve files for comparison from Bazaar, CVS, Darcs, Git, Mercurial, Monotone, RCS, Subversion, and SVK repositories.
http://mightycreak.github.io/diffuse/
GNU General Public License v2.0
258 stars 45 forks source link

Wrap lines #94

Open xlucn opened 3 years ago

xlucn commented 3 years ago

It is useful when comparing long lines, such as a long paragraph in natural languages.

johnblommers commented 3 years ago

But in fact Diffuse does not wrap lines. I hoped to use Diffuse to compare five versions of textual documents but without the word wrap it's for naught. I cannot see how to enable word wrap with Diffuse. Am I missing something? This is really important for this use case.

xlucn commented 3 years ago

@johnblommers I was posting this as a feature request, diffuse indeed does not wrap lines now.

johnblommers commented 3 years ago

Word wrap was discussed at the old Sourceforge repository as important but of course that went nowhere. According to the Diffuse roadmap word wrap is planned after release 0.9. That's good to know.

xlucn commented 3 years ago

vimdiff + diffchar plugin may be an alternative. I don't know if there are other programs with multi-way comparison and line wrapping.

MightyCreak commented 3 years ago

Sorry if I'm a bit distant nowadays, I want to and I'll be back on the project at some point but I have higher priorities right now (that said, PRs are always welcome :wink: ).

Apart from that, I agree that line wrapping would be a nice feature (and an important one as a matter of fact).

The roadmap is still the roadmap from the old website. Not saying that I won't follow it, but there might be some technical debts to fix first (upgrading to GTK 3 and Meson, and packaging to a few distros as well as Flatpak are already a good start in this direction).

johnblommers commented 3 years ago

Thanks for weighing in @MightyCreak. From my perch just adding in word wrap would elevate Diffuse head and shoulders above the other tools. Alas I lack the programming skill to add in word wrap so I won't be able to submit a pull request.

scarlion1 commented 6 months ago

I'd help work on this but not too keen on how or where to implement it.  If it's not too much trouble, can anyone summarize what parts of the code should be modified to add this?  I know a bit of the obvious, like there would need to be a checkbox option added to the prefs I suppose, or even just a toggle in the View menu, which triggers a new function toggleWrap() or something, right?  But, where would such a function go and what would it operate on?

Now that I think of it, though, surely others have already done such things, yes?  Part of what's great about open source is no need to reinvent the wheel.  What do we need, Python and GTK3?  Is this helpful/useful at all: https://github.com/esrille/textview-editor/commit/a07d02bcdda2ea88fd8456862ac2b94edc7fb3b4 ?

MightyCreak commented 6 months ago

It seems that Diffuse is not using a known GTK widget. I think a good entrypoint would be the method FileDiffViewerBase.replaceContents(self, f, ss) (f is an int and it represents the pane index, and ss is a List[str] representing the file contents).

From there, there is an object FileDiffViewerBase.Line which seems to be a good starting point as to how to represent a line of text.

Take that with a grain of salt, I'm still learning the thousands of lines of code of this project :sweat_smile:

scarlion1 commented 6 months ago

Actually, have you seen meld?  It has this option. Also it supports themes, which was the other issue here I was gonna look into, but not really needed right now, for me at least...

rulatir commented 1 week ago

Diffuse is THE ONLY LINUX VISUAL DIFF TOOL IN EXISTENCE THAT SUPPORTS PASTING TEXT DIRECTLY. Unfortunately lack of support for wrapping long lines makes the ONLY LINUX VISUAL DIFF TOOL IN EXISTENCE THAT SUPPORTS PASTING TEXT DIRECTLY a non-option.

joyously commented 1 week ago

Diffuse is THE ONLY LINUX VISUAL DIFF TOOL IN EXISTENCE THAT SUPPORTS PASTING TEXT DIRECTLY.

Uh, I'm pretty sure I pasted text in Meld a few days ago. And it seems like WinMerge or Beyond Compare could do it (but I haven't used them in a long while).