@codemirror/view 6.11.0 → 6.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +5 -0
- package/dist/index.cjs +5 -3
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.cjs
CHANGED
|
@@ -3019,15 +3019,17 @@ function computeCompositionDeco(view, changes) {
|
|
|
3019
3019
|
let newFrom = changes.mapPos(from, 1), newTo = Math.max(newFrom, changes.mapPos(to, -1));
|
|
3020
3020
|
let { state } = view, text = node.nodeType == 3 ? node.nodeValue :
|
|
3021
3021
|
new DOMReader([], state).readRange(node.firstChild, null).text;
|
|
3022
|
+
if (text.indexOf(LineBreakPlaceholder) > -1)
|
|
3023
|
+
return Decoration.none; // Don't try to preserve multi-line compositions
|
|
3022
3024
|
if (newTo - newFrom < text.length) {
|
|
3023
|
-
if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length)
|
|
3025
|
+
if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length)) == text)
|
|
3024
3026
|
newTo = newFrom + text.length;
|
|
3025
|
-
else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo
|
|
3027
|
+
else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo) == text)
|
|
3026
3028
|
newFrom = newTo - text.length;
|
|
3027
3029
|
else
|
|
3028
3030
|
return Decoration.none;
|
|
3029
3031
|
}
|
|
3030
|
-
else if (state.doc.sliceString(newFrom, newTo
|
|
3032
|
+
else if (state.doc.sliceString(newFrom, newTo) != text) {
|
|
3031
3033
|
return Decoration.none;
|
|
3032
3034
|
}
|
|
3033
3035
|
let topView = ContentView.get(node);
|
package/dist/index.js
CHANGED
|
@@ -3013,15 +3013,17 @@ function computeCompositionDeco(view, changes) {
|
|
|
3013
3013
|
let newFrom = changes.mapPos(from, 1), newTo = Math.max(newFrom, changes.mapPos(to, -1));
|
|
3014
3014
|
let { state } = view, text = node.nodeType == 3 ? node.nodeValue :
|
|
3015
3015
|
new DOMReader([], state).readRange(node.firstChild, null).text;
|
|
3016
|
+
if (text.indexOf(LineBreakPlaceholder) > -1)
|
|
3017
|
+
return Decoration.none; // Don't try to preserve multi-line compositions
|
|
3016
3018
|
if (newTo - newFrom < text.length) {
|
|
3017
|
-
if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length)
|
|
3019
|
+
if (state.doc.sliceString(newFrom, Math.min(state.doc.length, newFrom + text.length)) == text)
|
|
3018
3020
|
newTo = newFrom + text.length;
|
|
3019
|
-
else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo
|
|
3021
|
+
else if (state.doc.sliceString(Math.max(0, newTo - text.length), newTo) == text)
|
|
3020
3022
|
newFrom = newTo - text.length;
|
|
3021
3023
|
else
|
|
3022
3024
|
return Decoration.none;
|
|
3023
3025
|
}
|
|
3024
|
-
else if (state.doc.sliceString(newFrom, newTo
|
|
3026
|
+
else if (state.doc.sliceString(newFrom, newTo) != text) {
|
|
3025
3027
|
return Decoration.none;
|
|
3026
3028
|
}
|
|
3027
3029
|
let topView = ContentView.get(node);
|