Skip to content

Commit 3f6f7be

Browse files
committed
Merge pull request #162 from elixir-lang/indent-binary-sequence-inside-match-block
Indent binary sequence inside match block
2 parents 514a5c9 + 5ea9e16 commit 3f6f7be

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
### Enhancements
66

77
* [Indentation] Indent listing inside square brackets. (#160)
8-
* [Indentation] Ident correct after a binary sequence `<<1,2,3,4>>`.
8+
* [Indentation] Indent of binary sequence inside match block
9+
* [Indentation] Indent correct after a binary sequence `<<1,2,3,4>>`.
910
* [Indentation] Indent correct after oneline `def ... do:` function
1011
* [Indentation] Correct behavior after last line in buffer. (#145)
1112

elixir-smie.el

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,10 @@
264264

265265
(defun elixir-smie-rules (kind token)
266266
(pcase (cons kind token)
267+
(`(:before . "OP")
268+
(when (and (not (smie-rule-hanging-p))
269+
(smie-rule-prev-p "OP"))
270+
-2))
267271
(`(:after . "OP")
268272
(cond
269273
((smie-rule-sibling-p) nil)

test/elixir-mode-indentation-test.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -869,7 +869,7 @@ defmodule ExampleTest do
869869
end")
870870

871871
(elixir-def-indentation-test indent-binary-sequence-inside-match-block/2
872-
(:expected-result :failed :tags '(indentation))
872+
(:tags '(indentation))
873873
"
874874
case asd do
875875
<<c1::5, c2::5, c3::5, c4::5, c5::5, c6::5, c7::2>> ->

0 commit comments

Comments
 (0)