File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed
Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change @@ -965,6 +965,22 @@ def foo(test) do
965965 run(test_case)
966966end" )
967967
968+ ; ; Will pass when #180 is resolved.
969+ (elixir-def-indentation-test indent-after-bitstring/1
970+ (:tags '(indentation))
971+ "
972+ defmodule X do
973+ def a, do: <<1 :: size(8)>>
974+ def b, do: <<2 :: size(8)>>
975+ def c, do: <<3 :: size(8)>>
976+ end"
977+ "
978+ defmodule X do
979+ def a, do: <<1 :: size(8)>>
980+ def b, do: <<2 :: size(8)>>
981+ def c, do: <<3 :: size(8)>>
982+ end" )
983+
968984; ; We don't want automatic whitespace cleanup here because of the significant
969985; ; whitespace after `Record' above. By setting `whitespace-action' to nil,
970986; ; `whitespace-mode' won't automatically clean up trailing whitespace (in my
You can’t perform that action at this time.
0 commit comments