Commits

Meikel Brandmeyer  committed fc9f085

Move to first non-blank of line before calculating indent

  • Participants
  • Parent commits 8faf73c

Comments (0)

Files changed (1)

File indent/clojure.vim

 endfunction
 
 function! GetClojureIndent()
+	let c = getpos(".")
+	execute "normal ^"
+
 	" Find the next enclosing [ or {. We can limit the second search
 	" to the line, where the [ was found. If no [ was there this is
 	" zero and we search for an enclosing {.
 	endif
 
 	" Fallback to normal lispindent.
-	return lispindent(".")
+	let ind = lispindent(".")
+
+	call setpos(".", c)
+
+	return ind
 endfunction
 setlocal indentexpr=GetClojureIndent()