Skip to content

Annoying indentation behaviour when declaring data types #1081

Closed
@jstolarek

Description

@jstolarek

Say I have this code:

foo = undefinedX

where X is the cursor position. If I press Enter twice the cursor ends up at the beginning of a new line:

foo = undefined

X

This is all fine. Now consider a similar situation with data type declaration:

data Foo = Bar
         | BazX

Now pressing Enter twice yields:

data Foo = Bar
         | Baz

           X

This is mostly annoying. If I press Enter twice after a data constructor declaration then I almost certainly want to start some new declaration and thus expect the cursor to be placed at the beginning of a new line. So the rule should be: when pressing enter on a line that contains only whitespace characters place the cursor at the beginning of a new line. Note also that current behaviour is inconsistent:

data Foo = BarX

Pressing Enter here will place the cursor at the beginning of a new line, but I would really expect it to be placed under =:

data Foo = Bar
         X

Only when I press enter for the second time I want the cursor to be placed at the beginning of a new line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions