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

[Bug] incorrect indentation for curly braces with = #34

Open
alexmozaidze opened this issue Jun 22, 2023 · 2 comments · May be fixed by #31
Open

[Bug] incorrect indentation for curly braces with = #34

alexmozaidze opened this issue Jun 22, 2023 · 2 comments · May be fixed by #31
Labels
indentation Affects indentation

Comments

@alexmozaidze
Copy link

alexmozaidze commented Jun 22, 2023

When typing, indentation is correct, but when indenting using something like gg=G, the indentation becomes incorrect. The following example is in Fennel, but the idea is the same.

Correct indentation:

{1 :gbprod/cutlass.nvim
 :opts {:cut_key :x
        :exclude [:ns :nS]
        :registers {:change :c :delete :d :select :s}}}

After gg=G:

{1 :gbprod/cutlass.nvim
:opts {:cut_key :x
:exclude [:ns :nS]
:registers {:change :c :delete :d :select :s}}}

Also see neovim/neovim#24080

@axvr
Copy link
Member

axvr commented Jun 22, 2023

I'm unable to reproduce this bug in a *.clj file. But you might be interested to know that the indentation algorithm (and configuration) is getting a big rewrite in #31 that will make it faster, more reliable and should make it work better for Fennel too.

@axvr
Copy link
Member

axvr commented Jun 23, 2023

I think I might have figured out why the indentation in Fennel files was messed up. The Clojure indent script (currently) relies on syntax highlighting. So when used with Fennel, the "syntax groups" had different names so the indentation failed.

The PR I linked to yesterday (#31) will decouple Clojure indentation from syntax highlighting.

@axvr axvr added the indentation Affects indentation label Jun 23, 2023
@axvr axvr linked a pull request Jun 23, 2023 that will close this issue
16 tasks
@axvr axvr added this to the Indentation overhaul milestone Jun 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
indentation Affects indentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants