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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

### Enhancements

* [Indentation] Indent listing inside square brackets. (#160)
* [Indentation] Ident correct after a binary sequence `<<1,2,3,4>>`.
* [Indentation] Indent correct after oneline `def ... do:` function
* [Indentation] Correct behavior after last line in buffer. (#145)
Expand Down
8 changes: 8 additions & 0 deletions elixir-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,14 @@
;; Closing paren on the other line
(`(:before . "(")
(smie-rule-parent))
(`(:before . "[")
(cond
((smie-rule-hanging-p)
(smie-rule-parent))))
(`(:after . "[")
(cond
((smie-rule-hanging-p)
(smie-rule-parent elixir-smie-indent-basic))))
(`(:before . "->")
(cond
((smie-rule-hanging-p)
Expand Down
13 changes: 13 additions & 0 deletions test/elixir-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -914,6 +914,19 @@ case asd do
main
end")

(elixir-def-indentation-test indent-inside-square-brackets
(:tags '(indentation))
"
children = [
supervisor(Task.Supervisor, [[name: KVServer.TaskSupervisor]]),
worker(Task, [KVServer, :accept, [4040]])
]"

"
children = [
supervisor(Task.Supervisor, [[name: KVServer.TaskSupervisor]]),
worker(Task, [KVServer, :accept, [4040]])
]")

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