Meld for text comparisions?

Greetings melders:

So I’ve used meld for years for code comparisons and it’s marvelous. But I’m attempting to use it recently to merge two edits of a book a friend of mine is writing. Meld swapping (clicking on the left and right pointer arrows) is ‘line based’ of course. But with text, where line wrapping is arbitrary, depending on the width of the window, a ‘hard’ line is basically an entire paragraph. This makes the swapping arrows about useless – I can see the differences of course, but to make changes, I’m having to edit entirely manually.

Now, I’m wondering if it’s possible to make text swaps ‘one change at a time’, that is, each individual change is highlighted in dark blue, but there seems to be no way to copy over one dark blue change at a time – it’s the entire hard line or nothing. Is there some way of moving just one change? What I’m thinking of is some way to drag and paste an entire dark blue highlighted area. Of course I can left-drag to highlight an arbitrary block of text and then paste it, which isn’t exactly hard, but perhaps meld could automatically copy the entire dark blue highlighted area. Comparable to the way you can click and drag a URL into your browser – the entire URL is automatically included in the paste. Or perhaps meld just isn’t the right tool for that.

2 Likes

Currently this isn’t possible. There’s an open MR that’s quite old at this point that (and this is from memory, I haven’t looked in a while) probably just needs someone to shepherd it through and make it robust enough to actually merge.

There’s no immediately available option for what you want to do in Meld, I’m sorry.

1 Like

Thanks Kai. I was thinking about it a bit more, it sounds very doable. Click, hold, drag and drop any highlighted text. Could be something to add at some point. And not just between windows, but even inside one window.

Kai:

Further to the above. I found something interesting. Doing my text comparisons, meld was clearly panicking over my long lines (paragraphs) – all sorts of things in identical parts of the paragraph were being highlighted blue even tho they were identical in both copies. But then I entered a double return between paragraphs and voila! The comparison instantly went sane – only actual differences showed up.

Thoughts?

It’s hard to say for certain without a sample, but I think it’s extremely likely that inserting the line breaks caused the paragraph to actually align (rather than simply be in the same block). Meld (like other similar tools) first compares lines (in your case, paragraphs) and then runs the inline highlighting comparison. This means that unless you have identical paragraphs there is no sensible alignment between paragraphs, and the inline highlighting will be slow and not very useful.

Give it a try yourself. Take a few paragraphs of text from an email, make a few edits, save, and then compare. Then add the double returns. I’d love to be able to look under the hood to see what Meld is thinking.