FR: Three-way comparison for the V6 merge plugin

I am curious whether there’s a chance that the CodeMirror 6 merge plugin would support three-way diffs one day. Currently, the only alternatives I found is the CodeMirror 5 plugin as well as a curious, but currently small, project called MisMerge.

For background, I am quite interested in three-way comparison for use with Jujutsu for reasons explained here. I made a web-based tool called diffedit3 for this that is based on the CodeMirror 5 merge plugin. The plugin many nice features, but is difficult to use with modern web frameworks, and has many bugs that I don’t expect would ever get fixed.

I’m hoping to eventually move on to either use a hypothetical CodeMirror6 merge plugin with 3-way diff support, MisMerge, or something else.

Aside: a few examples of CodeMirror 5 merge plugin bugs:

  • If CodeMirror is created in a collapsed <details>, even if I carefully make sure that I call cm.editor().refresh() after the details is open, the left and right merge views are not rendered correctly. The line numbers end up mixed with the text. The center view gets rendered OK.

    My current workaround is to render the editor after the details are open.

  • Toggling line wrapping breaks collapsing of unchanged lines. I’m guessing that my best workaround is to destroy the editor completely and create a new one with the new settings.