elixir-editors / elixir-editors/emacs-elixir

Inconsistent indentation in `with`

Open
#397 2 comments 1 reaction 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
454
Forks
93
PR merge metrics
No merged PRs in 30d

Description

I have this gem of indentation in my code right now (and yes, that's how emacs wants it indented):

```elixir
def move_to_random_location(%{location_id: loc_id, id: id, exits: exits} = state) do
with true <- Enum.any?(exits),
info <- public_info(state),
%{from_id: new_loc_id} <- Enum.random(exits),
:ok <- World.Location.depart(loc_id, {{__MODULE__, id}, info, new_loc_id}),
{:ok, new_exits} <- World.Location.arrive(new_loc_id, {{__MODULE__, id}, info, loc_id}) do
%{state | location_id: new_loc_id, exits: new_exits}
else
false -> state
:not_in_location -> state
end
end
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.