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

Indentation leaking across documents #558

Closed
RedCMD opened this issue Jun 29, 2024 · 4 comments
Closed

Indentation leaking across documents #558

RedCMD opened this issue Jun 29, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@RedCMD
Copy link

RedCMD commented Jun 29, 2024

Describe the bug
Indentation doesn't seem to get reset correctly across ... document ends for flow mappings/sequences

To Reproduce

  a: b

...

{
  c: d
}

Expected behaviour
No error

Versions

  • Environment: VSCode 1.90
  • yaml: 2.4.5
  • extension: v1.15.0

Additional context
image

@RedCMD RedCMD added the bug Something isn't working label Jun 29, 2024
@eemeli
Copy link
Owner

eemeli commented Jun 29, 2024

I'm not able to replicate this problem with [email protected] directly, or with the VS Code YAML plugin. Does this show up for you consistently, or is there e.g. some specific sequence of editing steps that produces this error?

@RedCMD
Copy link
Author

RedCMD commented Jun 29, 2024

so far its been 100% consistent for both the 1.15.0 extension and [email protected]
just tested in https://insiders.vscode.dev/
installed the YAML extension and typed up a minimal example (copy paste also works)

 :
...
{
}

image
image

@eemeli
Copy link
Owner

eemeli commented Jun 29, 2024

Ah, now I see it. The snippet you posted earlier has a completely empty line before the ..., and the bug only shows up if it's preceded by a non-empty line. From the "Alt+F8" part of the tooltip, I gather that you're on Windows, where newlines are encoded as \r\n, and the CR is sufficient to make the line non-empty enough for whatever's causing this.

@RedCMD
Copy link
Author

RedCMD commented Jun 29, 2024

nice catch

changing the EOL to LF does indeed fix it

@eemeli eemeli closed this as completed in f685e1c Jun 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants