Skip to content

Auto-indent issue/question #21

Description

@cjsauer

Apologies if this is not the right place to be asking this, but I'm seeing a bit of odd behavior in my Clojure files regarding auto-indenting. I have tabstop=2, shiftwidth=2, and softtabstop=2 in my .vimrc file. When editing the following Clojure function, I can't seem to get indentation to work correctly for multiple-arity definitions.

(defn respond
  ([exchange body]
  ¦(respond identity exchange body))  ; <--- This should be one more space
  ([around exchange body]
  ¦(.sendResponseHeaders exchange OK 0)  ; <--- This should be one more space
  ¦(with-open [resp (around (.getResponseBody exchange))]
  ¦ ¦(.write resp (.getBytes body)))))

I've included the | characters to more easily show spacing. Notice how after the ([exchange body]\n, auto-indent is only placing a single space on the next line before the opening parenthesis, when it should actually be placing 2 spaces. Interestingly, this only seems to happen beneath the multi-arity definitions; everywhere else in my source is working correctly.

Any thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions