Decorations are improper on undo
FlyingBig opened this issue · comments
FlyingBig commented
Reproducible in vscode.dev or in VS Code Desktop?
- Not reproducible in vscode.dev or VS Code Desktop
Reproducible in the monaco editor playground?
- Not reproducible in the monaco editor playground
Monaco Editor Playground Link
Monaco Editor Playground Code
var jsCode = "function Person(age) {if (age)123456{this.age = age;}}"
var editor = monaco.editor.create(document.getElementById("container"), {
trimAutoWhitespace: false,
value: jsCode,
language: "javascript",
});
setTimeout(() => {
editor.executeEdits("", [{
range: new monaco.Range(1, 1, 1, 99),
text: "function Person(age) {\n if (age)123456{\n this.age = age;\n }\n}",
forceMoveMarkers: true,
}]);
editor.createDecorationsCollection([
{
range: new monaco.Range(2, 7, 2, 10),
options: { inlineClassName: "myInlineDecoration", shouldFillLineOnLineBreak: false },
},
]);
console.log(editor)
}, 3000)
Reproduction Steps
3 seconds after the editor was loaded, I added a decorator ("age"), and then I withdrew (ctrl+z), and the original "age" in the editor changed to "123".
- open url
- wait a few seconds
- undo when editor content changes
Actual (Problematic) Behavior
The content of the decorator has changed
Expected Behavior
after the retraction, the decorator content is normal.
Additional Context
No response