@marijn Hello! I’m using the latest version Merge plugin with Vue3.0, the diff function seems not working well when I use YAML or XML file. two panel with same content, but it always verdict the whole b panel was changed.

And a crush happened when I click the revert button or type in b panel ,
here is my code
<template>
<div ref="Cm" style="width: 100%; height: 100%"></div>
</template>
<script setup lang="ts">
import { basicSetup } from 'codemirror'
import { indentWithTab } from '@codemirror/commands'
import { MergeView } from '@codemirror/merge'
import { onMounted, onBeforeUnmount, watch } from 'vue'
import { dracula } from '@ddietr/codemirror-themes/dracula'
import { keymap } from '@codemirror/view'
import { EditorState } from '@codemirror/state'
import { json, jsonParseLinter } from '@codemirror/lang-json'
import { linter, lintGutter } from '@codemirror/lint'
import { StreamLanguage } from '@codemirror/language'
import { yaml } from '@codemirror/legacy-modes/mode/yaml'
const Cm = $ref<any>()
const props = defineProps({
oText: {
type: String,
required: true,
},
mText: {
type: String,
required: true,
},
})
let eView = $ref<MergeView>()
const initEditor = () => {
eView = new MergeView({
a: {
extensions: [basicSetup, dracula, EditorState.readOnly.of(true)],
doc: props.oText,
},
b: {
extensions: [
basicSetup,
dracula,
keymap.of([indentWithTab]),
// StreamLanguage.define(yaml),
// json(),
// linter(jsonParseLinter()),
// lintGutter(),
],
doc: props.mText,
},
parent: Cm,
revertControls: 'a-to-b',
})
}
const getDoc = () => {
console.log(eView?.chunks)
return eView?.b.state.doc.toString()
}
onBeforeUnmount(() => {
eView?.destroy()
})
onMounted(() => {
initEditor()
})
watch([() => props.mText], () => {
eView?.b.dispatch({ changes: { from: 0, to: eView.b.state.doc.length, insert: props.mText } })
})
watch([() => props.oText], () => {
eView?.a.dispatch({ changes: { from: 0, to: eView.a.state.doc.length, insert: props.oText } })
})
defineExpose({ getDoc })
</script>
two problem only happened with YAML and XML, other languages are fine.
please help me resolve it.