You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, Clojure has macros, so defn isn't special at all. People define their own def functions all the time. An example is the popular web framework, Compojure:
(defroutesfoo
(GET"/" [] "Hello!"))
But codemirror tries to indent the above like so:
(defroutesfoo
(GET"/" [] "Hello World!"))
To solve this problem, the various editors for Clojure implement a rule where anything starting with def and with are indented in the same way as a defn form is indented. The Emacs mode and Vim plugin both do this. In Emacs, it is on by default (which I think is correct as this is the widely accepted convention) and it is optional in Vim.
It'd be great to have this in codemirror too. If it is on by default, even better.
The text was updated successfully, but these errors were encountered:
If you write a function, it looks like this:
However, Clojure has macros, so
defn
isn't special at all. People define their owndef
functions all the time. An example is the popular web framework, Compojure:But codemirror tries to indent the above like so:
To solve this problem, the various editors for Clojure implement a rule where anything starting with
def
andwith
are indented in the same way as adefn
form is indented. The Emacs mode and Vim plugin both do this. In Emacs, it is on by default (which I think is correct as this is the widely accepted convention) and it is optional in Vim.It'd be great to have this in codemirror too. If it is on by default, even better.
The text was updated successfully, but these errors were encountered: