Skip to content

Fix indent of pipes inside blocks of 'def' for example #318

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 3, 2016
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
2 changes: 1 addition & 1 deletion elixir-smie.el
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@
(smie-rule-parent))
((and (not (smie-rule-hanging-p))
(elixir-smie-current-line-start-with-pipe-operator-p))
(goto-char (elixir-smie--previous-line-indentation)))
(cons 'column (elixir-smie--previous-line-indentation)))
((and (not (smie-rule-hanging-p))
(smie-rule-prev-p "OP"))
-2)
Expand Down
22 changes: 22 additions & 0 deletions test/elixir-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,28 @@ def foo(x) do
|> Enum.reverse
end")


(elixir-def-indentation-test indent-pipes-inside-blocks
(:tags '(indentation))
"
defmodule Foo do
def bar do
baz =
[1,2,3,4,5,6,7,8,9]
|> Enum.reverse
|> Enum.filter(&(&1 > 5))
end
end"
"
defmodule Foo do
def bar do
baz =
[1,2,3,4,5,6,7,8,9]
|> Enum.reverse
|> Enum.filter(&(&1 > 5))
end
end")

(elixir-def-indentation-test indent-inside-parens
(:tags '(indentation))
"
Expand Down