Issue #3 resolved

Indenting doesn't work correctly on toplevel

Meikel Brandmeyer
repo owner created an issue

Reported by the clojure group by James Reeves:

„Does anyone else suffer from occassional incorrect indentations in VimClojure? It looks like VimClojure is preferring the indentation layer of a previous set of [] over the current set of (). For example:



(defn foo [x] (+ x 1)) }}}

When I hit enter after the second "x", the 1 is indented a long way to the right. It seems to be getting it's indentation level from the argument vector, instead of from the current parentheses.

Here's another example:



(f something-very-long (g x y)) }}}

Is this just me, or does anyone else have this issue?“

James tracked this down to a rebinding on of the w command. VC executes a „normal w“ triggering the bug. The solution for the issue is to use „normal! w“ to avoid triggering eventually defined mappings.

Yokoten: go through the whole script to fix any invokation of a command which might trigger a mapping.

Why did it slip? I was well aware of „normal!“, but I didn't expect anyone to change the binding of w.

Prevent re-occurrence: For the future use only „normal!“ and check also other commands, whether mappings might get triggered.

Thanks to James Reeves for tracking this down!

Comments (2)

  1. Log in to comment