Skip to content

[FR]: Enhance the indentation logic #443

@past-gen

Description

@past-gen
  • Add an option to insert the preferred indentation character at the cursor(s) position, unless currently in-selection. This would be extremely useful for formatting string patterns or manually aligning variables or comments for... aesthetic purposes, while not interfering with the intentional line(s) indentation process:

    insertion.webm
  • Make indentation detection within code blocks a tad-bit smarter:

    • It tends to fail when a new (first) line is added to a non-empty block using the 'Enter' key
    • (Ctrl/Shift)+Enter should behave the same way at the very beginning of a non-empty line as it does at the end. Currently, it treats the line as an empty one and does not insert any indentations.
      UPD.1: After giving it some thought, I can see how it could be useful to visually separate lines without leaving trailing spaces, so no pressure here.
    detection.webm

It's not exactly related, but I find it really inconvenient that, if you put the cursor at the start of a line and press Ctrl+BS, it will delete not only the new-line character, but whatever was aligned to it on the previous line, too. ( The first vid partially catches my struggle )

Can you make it less greedy, please? Perhaps, It'd be a good idea to only allow \s characters in such situations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions