Skip to content

Indentation with a guard on a new line #488

Open
@Nondv

Description

@Nondv

If I just write code naturally and indent everything:

def func(x)
when x.y = 1 do
  abc
end

After elixir-format:

def func(x)
    when x.y = 1 do
  abc
end

and now when I add something after the function, the indentation breaks:

def func(x)
    when x.y = 1 do
  abc
end

    def id(x) do
      x
    end

also, shouldn't the mode's formatting be at least a little bit similar to the format tool?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions