elixir-editors / elixir-editors/emacs-elixir

Defined function with `when` and without parenthesis produces incorrect indentation in body

Open
#391 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Emacs Lisp
Stars
454
Forks
93
PR merge metrics
No merged PRs in 30d

Description

## Description

When I have a defined, multi-line function and a `when` with multiple operators without parenthesis, the function body is not indented properly.

## Example

Expected

```
def foo(x) when x + 1 > y do
[]
end
```

Actual

```
def foo(x) when x + 1 > y do
[]
end
```

Note: This does not happen when `x + 1` is wrapped in parenthesis

```
def foo(x) when (x + 1) > y do
[]
end
```

## Versions

OS: Mac OSX Sierra
Emacs Version: GNU Emacs 25.1.1
elixir-mode: 20170102.942

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.