File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 455455 (t elixir-smie-indent-basic)))
456456 (`(:before . " if" )
457457 (cond
458+ ; ; Indent when if is inside a `->' block
459+ ; ;
460+ ; ; Example:
461+ ; ;
462+ ; ; whatever ->
463+ ; ; if true do <-
464+ ; ; :foo
465+ ; ; end
466+ ; ; ....
467+ ((elixir-smie-last-line-end-with-block-operator-p)
468+ (smie-rule-parent elixir-smie-indent-basic))
458469 (t
459470 (smie-rule-parent ))))
460471 (`(:before . " ->" )
Original file line number Diff line number Diff line change @@ -1333,6 +1333,37 @@ defmodule MyModule do
13331333end
13341334" )
13351335
1336+ (elixir-def-indentation-test complex-case-with-matches/4
1337+ (:tags '(indentation))
1338+ "
1339+ case :foo do
1340+ 1 ->
1341+ try true do
1342+ :foo
1343+ end
1344+ 2 ->
1345+ false
1346+ end
1347+
1348+ fn x ->
1349+ if true do
1350+ end
1351+ end"
1352+ "
1353+ case :foo do
1354+ 1 ->
1355+ try true do
1356+ :foo
1357+ end
1358+ 2 ->
1359+ false
1360+ end
1361+
1362+ fn x ->
1363+ if true do
1364+ end
1365+ end" )
1366+
13361367(elixir-def-indentation-test close-map-curly-brackt
13371368 (:tags '(indentation))
13381369"
You can’t perform that action at this time.
0 commit comments