Skip to content

Make indent-according-to-mode continue previous line indentation on empty lines #1265

Open
@gracjan

Description

@gracjan

indent-according-to-mode is called in:

  1. In newline-and-indent.
  2. In electric-indent-mode after \n has been inserted.
  3. In evil-open-above.
  4. In evil-open-below.

Each of these cases is same: it is to semantically continue previous line. So we need:

  1. If previous line ends with operator, continue expression.
  2. If inside parenthesized expression, continue on the level of the expression.
  3. Lacking other context continue same indentation block.

Note that haskell-indentation already has haskell-indentation-newline-and-indent that touches this problem but hard to say how good it is.

Reference: syl20bnr/spacemacs#5010, syl20bnr/spacemacs#621, syl20bnr/spacemacs#3162, #896

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