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

Add indentation setting to indent to the same level as the previous form #979

Open
danielcompton opened this issue Jul 23, 2015 · 1 comment

Comments

@danielcompton
Copy link
Collaborator

We're using [clairvoyant] to trace namespaces, and we need to wrap everything in a trace-forms macro. Currently this indents everything one level. It would be great if we could have a Cursive indentation setting to indent to the same level as the previous form.

So

(trace-forms {:tracer (tracer :color "green")}

  (defn filter-fn-for
    [showing-kw]
    (case showing-kw
      :active (complement :done)
      :done :done
      :all identity))
)

is instead indented as

(trace-forms {:tracer (tracer :color "green")}

(defn filter-fn-for
  [showing-kw]
  (case showing-kw
    :active (complement :done)
    :done :done
    :all identity))
)
@imrekoszo
Copy link

This is still open in 1.12.4-2022.2 as discussed with @cursive-ide in a slack thread.

There are similar macros out in the wild, https://github.com/cgrand/macrovich is an example. Some devs might prefer their top-level comment blocks to be formatted like this (I sometimes do).

In my experience these special wrapper macros mostly appear as top-level forms, and could be nested:

(def foo :foo)

(wrapper-1

(def bar :bar)

)

(wrapper-2
(wrapper-3

(def baz :baz)

))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants