clojure.vim icon indicating copy to clipboard operation
clojure.vim copied to clipboard

[Bug] incorrect indentation for curly braces with `=`

Open alexmozaidze opened this issue 2 years ago • 2 comments

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 https://github.com/neovim/neovim/issues/24080

alexmozaidze avatar Jun 22 '23 13:06 alexmozaidze

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 avatar Jun 22 '23 14:06 axvr

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 avatar Jun 23 '23 07:06 axvr