Skip to content

Line indent doesn't handle leading whitespace properly #1620

Closed

Description

Indenting a line with leading whitespace seems to have some corners that need ironing out. It appears to be attempting something smart about tab-stop alignment, but it should really just be dumb and indent all lines the same.

e.g.
screen shot 2015-12-23 at 1 42 16 pm

screen shot 2015-12-23 at 1 43 09 pm

Right-justified tabular data is affected by this (e.g. output of many Powershell commands, or the robocopy usage message)

screen shot 2015-12-23 at 1 45 18 pm

screen shot 2015-12-23 at 1 45 33 pm

Activity

  1. added
    bug
    on Dec 24, 2015
  2. alexdima commented on Jan 14, 2016

    @alexdima
    Member

    Maybe we should have an option for "dumbing down" the indent/unindent actions. Our thinking was to optimize them for source code, where mostly I'd say "leading whitespace aligned" lines are highly desirable.

  3. latkin commented on Jan 14, 2016

    @latkin
    Author

    I would recommend the default behavior be "dumb" block indenting (same as Visual Studio, Notepad++, every other editor), with an option "Block indent performs auto-formatting" or the like.

    Even in source code this can be destructive/annoying. Unless every line is already aligned to a tab stop, stuff is liable to get jumbled. Certainly I like that my editor can auto-format for me when I ask it to, but I don't want it to do so during a bulk indent action.

    indent

  4. alexdima commented on Apr 5, 2017

    @alexdima
    Member

    The indentation commands will now respect the editor.useTabStops setting. In other words, to get this behaviour, set editor.useTabStops: false.

  5. locked and limited conversation to collaborators on Nov 18, 2017
  6. added a commit that references this issue on Sep 6, 2026
    c380d8a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions