Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion elixir-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,10 @@
(smie-rule-parent elixir-smie-indent-basic)
(if (elixir-smie-last-line-start-with-block-operator-p)
(smie-rule-parent -2)
(smie-rule-parent))))))
(smie-rule-parent))))
((and (smie-rule-parent-p "OP")
(smie-rule-hanging-p))
(smie-rule-parent))))
(`(:after . "{")
(cond
((smie-rule-hanging-p)
Expand Down
24 changes: 22 additions & 2 deletions test/elixir-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,8 @@ defmodule Foo do
end
")

(elixir-def-indentation-test complex-case-with-matches (:tags '(indentation))
(elixir-def-indentation-test complex-case-with-matches
(:tags '(indentation))
"
case parse do
{ [ help: true ], _, _ }
Expand All @@ -1207,7 +1208,8 @@ case parse do
end")


(elixir-def-indentation-test complex-case-with-matches/2 (:tags '(indentation))
(elixir-def-indentation-test complex-case-with-matches/2
(:tags '(indentation))
"
case parse do
{ [ help: true ], _, _ }
Expand All @@ -1229,6 +1231,24 @@ case parse do
_ -> :help
end")

(elixir-def-indentation-test close-map-curly-brackt
(:tags '(indentation))
"
config = %{
async_cases: [],
exclude: opts[:exclude],
include: opts[:include],
timeout: opts[:timeout],
trace: opts[:trace]
}"
"
config = %{
async_cases: [],
exclude: opts[:exclude],
include: opts[:include],
timeout: opts[:timeout],
trace: opts[:trace]
}")

;; We don't want automatic whitespace cleanup here because of the significant
;; whitespace after `Record' above. By setting `whitespace-action' to nil,
Expand Down