Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrap lines #94

Open
xlucn opened this issue Apr 5, 2021 · 9 comments
Open

Wrap lines #94

xlucn opened this issue Apr 5, 2021 · 9 comments

Comments

@xlucn
Copy link

xlucn commented Apr 5, 2021

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

@johnblommers
Copy link

johnblommers commented Apr 19, 2021

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
Copy link
Author

xlucn commented Apr 19, 2021

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

@johnblommers
Copy link

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
Copy link
Author

xlucn commented Apr 19, 2021

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

@MightyCreak
Copy link
Owner

MightyCreak commented Apr 19, 2021

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 😉 ).

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
Copy link

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
Copy link

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:
esrille/textview-editor@a07d02b ?

@MightyCreak
Copy link
Owner

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 😅

@scarlion1
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants