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

VS Code is incorrectly rendering text with decorations after the lines are deleted #44872

Closed
sean-mcmanus opened this issue Mar 1, 2018 · 2 comments
Assignees
Labels
info-needed Issue requires more information from poster

Comments

@sean-mcmanus
Copy link
Contributor

sean-mcmanus commented Mar 1, 2018

  • VSCode Version: 1.21.0 Insiders
  • OS Version: Windows

Steps to Reproduce:

  1. Install the C++ extension.
  2. Use code like
int main()
{
#ifdef foo
text should appear gray here
#endif
}
  1. Select the entire main method and start typing something else.

Bug: The new code is gray even though the lines are deleted. VS code appears to not handle the case where decorations are set on lines but the lines are removed. Our code eventually sends new text decorations but it takes a while to process.

image

@alexdima
Copy link
Member

alexdima commented Mar 2, 2018

@sean-mcmanus

You can control the behaviour of a text editor decoration via DecorationRenderOptions.rangeBehavior when creating it, which describes how the decoration should grow when inserting text at the edges of the decoration.

To be able to reproduce, can you please create a minimal code snippet which reproduces the problem for you. Like e.g. in #34004 , or in #37401

@alexdima alexdima added the info-needed Issue requires more information from poster label Mar 2, 2018
@sean-mcmanus
Copy link
Contributor Author

Thanks a lot for informing us about rangeBehavior. We should've probably noticed that before. Yeah, setting the setting to ClosedOpen appears to fix the issue for us exactly how we want.

@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 17, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants