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

IModelDecorationOptions IsWholeLine extends range in unexpected ways #4784

Open
1 of 2 tasks
thejonathanbrown opened this issue Dec 13, 2024 · 0 comments
Open
1 of 2 tasks

Comments

@thejonathanbrown
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.52.2#example-interacting-with-the-editor-line-and-inline-decorations

Monaco Editor Playground Code

Nothing special, just using the decorations example

Reproduction Steps

  1. Notice the line decoration spans lines 3-5 and has isWholeLine = true
  2. Select and delete lines 3-5
  3. Notice that line 2 now has the line decoration
  4. Ctrl+z until lines 3-5 are restored
  5. Notice that the decoration now spans lines 2-5

Actual (Problematic) Behavior

Decorating a line that was never marked to be decorated is unexpected. The decoration was for line 3-5, so having line 2 decorated once 3-5 are deleted decorates something that was never the original intention. Ditto to line 2 still being decorated after the undo.

Expected Behavior

If a decorated line is deleted I would expect the decoration to be deleted as well, not move to a previously undecorated line. Granted, I could be missing some other context, but from evaluating Monaco as a potential replacement in our app, this is something that stood out as unexpected and would make it challenging to use full line decorations (something that we currently do a lot)

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