File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -927,12 +927,20 @@ When called from lisp code align everything between BEG and END."
927
927
(backward-up-list )
928
928
(forward-sexp 1 )
929
929
(point-marker )))
930
- (clojure-align-forms-automatically nil ))
931
- (align-region (point ) sexp-end " ^ *$"
932
- '((clojure-align (regexp . clojure--search-whitespace-after-next-sexp)
933
- (group . 1 )
934
- (repeat . t )))
935
- nil )
930
+ (clojure-align-forms-automatically nil )
931
+ (count 1 ))
932
+ ; ; For some bizarre reason, we need to `align-region' once for each
933
+ ; ; group.
934
+ (save-excursion
935
+ (while (search-forward-regexp " ^ *\n " sexp-end 'noerror )
936
+ (incf count)))
937
+ (dotimes (_ count)
938
+ (align-region (point ) sexp-end nil
939
+ '((clojure-align (regexp . clojure--search-whitespace-after-next-sexp)
940
+ (group . 1 )
941
+ (separate . " ^ *$" )
942
+ (repeat . t )))
943
+ nil ))
936
944
; ; Reindent after aligning because of #360.
937
945
(indent-region (point ) sexp-end)))))
938
946
Original file line number Diff line number Diff line change 488
488
" (let [a b
489
489
c d])" )
490
490
491
+ (def-full-align-test blank-line
492
+ " (let [this-is-a-form b
493
+ c d
494
+
495
+ another form
496
+ k g])"
497
+ " {:this-is-a-form b
498
+ c d
499
+
500
+ :another form
501
+ k g}" )
502
+
491
503
(def-full-align-test basic-reversed
492
504
" {c d
493
505
:this-is-a-form b}"
You can’t perform that action at this time.
0 commit comments