Skip to content

Indent closing brackets/parens after commas more sensibly #22

Description

@hcs42

Consider having a list:

[some_long_name,
 some_other_long_name]

The easiest way to add a third element is by moving over the ] character, pressing i, typing a comma and then enter. After the auto-indentation, the code will look like this:

[some_long_name,
 some_other_long_name,
]

It would be more convenient to have this:

[some_long_name,
 some_other_long_name,
 ]

We cannot just say that from now on we align the ] with the beginning of the previous line, because that would mean having incorrect indentations like this one:

[some_long_name,
 some_other_long_name
 ]

The proposal is that when indenting ], we should examine the previous token, and if it is a comma, we could indent the ] line as if it started with e.g. an atom.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions