Skip to content

Commit 8debd7d

Browse files
committed
Modify SMIE rules for 1-line fns w/ bitstrings.
Fixes #180. Please see the above issue for full explanation of issue resolved with this change.
1 parent a56e517 commit 8debd7d

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

elixir-smie.el

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,13 @@
272272
(cond
273273
((smie-rule-sibling-p) nil)
274274
((smie-rule-hanging-p) (smie-rule-parent elixir-smie-indent-basic))
275+
((and (not (smie-rule-sibling-p))
276+
(not (smie-rule-hanging-p))
277+
(smie-rule-parent-p "do:"))
278+
;; Dedent the line after an OP if it's after a "do:" token, which implies
279+
;; a one-line function.
280+
(smie-rule-parent
281+
(- (+ elixir-smie-indent-basic elixir-smie-indent-basic))))
275282
(t (smie-rule-parent))))
276283
(`(:before . "MATCH-STATEMENT-DELIMITER")
277284
(cond

0 commit comments

Comments
 (0)