Skip to content

Commit 597818c

Browse files
committed
Fix case of atoms inside lists
1 parent 9845861 commit 597818c

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

elixir-smie.el

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@
330330
-4)
331331
(`(:elem . args)
332332
-4)
333+
(`(:close-all . "}")
334+
(smie-rule-parent -222)
335+
)
333336
(`(:before . "OP")
334337
(cond
335338
((and (not (smie-rule-hanging-p))
@@ -529,7 +532,9 @@
529532
(smie-rule-hanging-p))
530533
(smie-rule-parent))
531534
((smie-rule-parent-p "[")
532-
(smie-rule-parent))
535+
(if (nth 0 smie--parent)
536+
(smie-rule-parent elixir-smie-indent-basic)
537+
(smie-rule-parent)))
533538
((smie-rule-parent-p "->")
534539
(if (save-excursion
535540
(move-end-of-line 1)

test/elixir-mode-indentation-test.el

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,6 +1835,12 @@ end
18351835
(elixir-def-indentation-test indent-maps-inside-list
18361836
(:tags '(indentation))
18371837
"
1838+
[
1839+
{1, 2, 3},
1840+
{4, 5, 6},
1841+
{7, 8, 9}
1842+
]
1843+
18381844
[
18391845
%{
18401846
name: \"John Doe\",
@@ -1851,6 +1857,12 @@ email: \"jane@doe.org\",
18511857
]
18521858
"
18531859
"
1860+
[
1861+
{1, 2, 3},
1862+
{4, 5, 6},
1863+
{7, 8, 9}
1864+
]
1865+
18541866
[
18551867
%{
18561868
name: \"John Doe\",

0 commit comments

Comments
 (0)