Closed ondrejmirtes closed 4 months ago
Deleted text is highlighted. I'm not sure how that screenshot was made, it seems to use different styling than the default (compare). Maybe some mistake was made in the custom styles?
Yeah, I have custom styles but without them it still doesn't work. It can't because the current DOM is not structured for that.
This is how it looks with the default styles:
Oh, right, unified view, I was looking at the split merge view. That indeed doesn't seem to render changed spans separately.
One unrelated question: how can I expect getChunks(state)
to look in the unified merge view? Do they always have side
set to 'b'
? It seems like that from my testing (I don't know what text should I produce in order to have some chunks on side 'a'
). Thanks.
side
is a per-editor thing that tells you which side of the chunks represent the document in that editor. In a split merge view both editors have a different side. In a unified view the editor is always b
, and a
refers to the given original document.
I have the same issue. An example:
I expect only the words always
and Custom
(on line 3 and 7 respectively) to be crossed over, not the whole lines.
@marijnh Would you say there's a good chance of this getting fixed in the near future? Obviously it's not something we can demand of you, it would just be helpful to know, to decide if we should consider Monaco instead, because I think this issue would be a blocker for our scenario unfortunately.
This was supposed to already work, but the highlighting code was a bit confused. Attached patch should help.
It does indeed, works in 6.6.4 🎉 - thank you!
Describe the issue
Hello, I'm really grateful that CM6 includes unifiedMergeView. When I started a project that needs it, I had no idea whether I'll have to spend several days implementing my own (inferior) solution, but fortunately I found
@codemirror/merge
.I have a suggestion: in the diff like this:
I'd like if
-next-line
part of the deleted line was insidecm-deletedText
so that it'd also be highlighted similarly toidentical.alwaysFalse, booleanAnd.alwaysFalse
part of the added line.This is currently how the DOM looks like:
I'd prefer if it looked something like this:
Thank you for considering this.
Browser and platform
No response
Reproduction link
No response