-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Unexpected indentation when editing nix/lua files. #1712
Comments
I forgot to post my configs. I can reproduce the same behavior without any configs though. theme = "base16_terminal"
[keys]
[keys.insert]
[keys.insert.j]
j = "normal_mode"
[keys.normal]
G = ["select_all", "collapse_selection"]
[lsp]
display-messages = true [[language]]
auto-format = true
comment-token = "--"
file-types = ["lua"]
injection-regex = "^lua$"
name = "lua"
scope = "scope.lua"
[language.config]
codeAction = true
completion = true
documentFormatting = true
documentSymbol = true
hover = true
[language.language-server]
command = "efm-langserver" |
I can't fully remember but there was an issue with nix indentation because toplevel code always got parsed under the same root scope
this clearly has no indentation
And it was impossible to distinguish between the two. So indentation was always off. See also #1562 for a new indentation system. |
I just checked, this works correctly in #1562. The cause of the issue is probably the same as in #1523. Regarding other problems with the nix indentation it should be possibe to fix them once we use tree-sitter queries for indentation. I'm not familiar with nix though, so that should probably be done by someone else later. |
I am closing this since the changes @Triton171 mentioned regarding the indent system have long landed. I think the issues mentioned here work now. Speicfuc improvements to the nix queries can be tracked in a new issue if they arise |
I'm not certain if this is expected behavior or not, but it's certainly unexpected/annoying to me. If there's a configuration for this that I missed in the docs, I apologize.
When editing nix or lua files, the indentation is unexpected when creating a new attribute set or table. I would expect the next line after an opening bracket to be a single indentation after the line above it. I would expect pressing enter while in this state:
would produce this:
instead it produces this:
When nested deeper, it acts weirder:
produces this:
Reproduction steps
Environment
~/.cache/helix/helix.log
I only took the last 250 lines because GitHub was complaining. Hopefully, there's nothing sensitive in here.
The text was updated successfully, but these errors were encountered: