Olical / aniseed

Neovim configuration and plugins in Fennel (Lisp compiled to Lua)
https://discord.gg/wXAMr8F
The Unlicense
606 stars 28 forks source link

Wrong indentation of `if` form #138

Closed anuvyklack closed 1 year ago

anuvyklack commented 1 year ago

The correct indentation of if form should be:

(if condition
    (first branch)
    (second branch))

but Aniseed indents it like this:

(if condition
  (first branch)
  (second branch))

Neovim without Aniseed indents if forms correctly.
It happens both when go to the new string in insert mode, or using = operator in normal mode.

Olical commented 1 year ago

This isn't something Aniseed chooses on purpose, the indentation comes from the official https://github.com/bakpakin/fennel.vim - I haven't changed that in any significant way other than add support for a few newer language features IIRC.

I don't want to change Aniseed and the fennel.vim syntax file (which I didn't write) for this case, this is a style choice and it was made a while ago. I personally prefer the Clojure style indentation of two spaces regardless for if statements, I'm sure it'll be a coin toss in the community for which people prefer.

I'd recommend looking into how to override parts of the fennel syntax that configure this sort of thing so it can be done on a per user basis.