Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decorations are improper on undo #4587

Open
1 of 2 tasks
FlyingBig opened this issue Jul 3, 2024 · 0 comments
Open
1 of 2 tasks

Decorations are improper on undo #4587

FlyingBig opened this issue Jul 3, 2024 · 0 comments

Comments

@FlyingBig
Copy link

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.50.0#XQAAAAJOAwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw2TFFKXzoBtNlUc7JzEx8NDAUbFLl_jqQ-13Gd-1RJYH2Zt9Ji-HKLTQUAY3dr9vTn3QH3Ox7hyIstkn4D6ZgA6N_RtXb_HexBA6A5D_L5VxZvx6s0f-RwMssATjNUJpb9kRqAa052ldBleV6_U8X6JnEBsGPqfGqZ87bKknyqjy3E23r3KPMjf81SjBsa5BcM7-d4u3fo-eUpOtuI5uC9JI029j_XR8UAKeRFfKhnU0_yB4TuUHTO433mmfZMWSozpRO45JzMlhV12g44qux8ZlGx-pM-IMoNWmYjf4bwsDbeuePq5Bjwc44ixyPWydGF3zPUbs-gPwLCwwjj9t4qLtmqptgM1Ydt6Wse7qZDIMhd9VX7HKQWKAOVOyu9ZN26-HTHTQ1oKuLC3a1vsdpv1Ia0oafZdS6teRsd9LfelyHfjzq9KU0Q9KVXGy4NamprsOMUOMJTHN9hKYwRR8IblIVSX7C5H4TJ9pTfdtCuHnc9yCMZ22U3GAu3-DpUveWkpQ8iMmNJtPJIQCEG_rZTcDABslJzhSs-0yPpfdCgAD5MjmHn1SfP6WxLkZkCaQ7DSlkMAxX0GMdDvoZBVUzyW6308oAFPZmwbNr_1Ek_1mRdXvG0xKiahF2xN5qVP_2sJXM

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".

  1. open url
  2. wait a few seconds
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant