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

Curly braces in strings manipulate the indentation level #379

Open
SnipUndercover opened this issue Aug 7, 2024 · 0 comments
Open

Curly braces in strings manipulate the indentation level #379

SnipUndercover opened this issue Aug 7, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@SnipUndercover
Copy link

SnipUndercover commented Aug 7, 2024

Version

C# REPL 0.6.7+d2955f13e744320cd6331c484e1286c3ed4f8612

What happened?

Entering curly braces ({}) in strings manipulates the current indentation level, despite being regular characters in this context.

This can be reproduced by entering the following snippet:

{
    var _ = "}";

Pressing Enter at this point will dedent the next line, which is unexpected. After entering a statement, adding a semicolon (;) or closing curly brace (}) will fix the indentation, like so:

{
    var _ = "}";
Console.WriteLine()  // putting a ; or } here will fix the indentation

Because the level of indentation is now desynced, closing the code block by adding another closing brace (}) will set the indentation level to -1. Pressing Shift+Enter at this point will crash the REPL; see #378.

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