Skip to content

Multi-line indents do not preserve partial indents #15598

Closed

Description

@lewisl9029
  • VSCode Version: 1.7.1
  • OS Version: macOS Sierra 10.12.1

I'm using VSCode for Clojure editing right now and have been running into this issue a lot. This seems to be a general problem with VSCode's indentation mechanism though, and not a language specific problem. I've also verified that it's reproducible on the latest master build without any extensions or customizations applied.

Steps to Reproduce:

  1. Set indentation to 2 spaces
  2. Paste the following into an empty editor:
  {:key1 :value1
   :key2 :value2}
  1. Select both lines and press tab

Expected:

Both lines are indented by the standard indentation size of 2 spaces. This is the standard behavior in Atom, as well as most other editors I've worked with:

nov-16-2016 15-33-50

Actual:

Both lines are indented to the same indentation level, and the partial indent on the second line is discarded:

nov-16-2016 15-16-03

I tried poking around in the source code a bit but couldn't quite figure out where this functionality lives. If someone could just point me in a general direction, I can try giving it another shot.

Activity

  1. normalser commented on Nov 17, 2016

    @normalser

    Something similar: #9409

  2. ramya-rao-a commented on Nov 17, 2016

    @ramya-rao-a
    Contributor

    alexandrudima Would this be tracked as part of #15598 or separate?

  3. alexdima commented on Nov 30, 2016

    @alexdima
    Member

    Today, indenting and unindenting always tries to "snap" the text to tab stops.

    I think we could piggy back on the existing setting editor.useTabStops and "snap" the text to tab stops only when the setting is off.

  4. added
    feature-request
    editor-contrib
    on Nov 30, 2016
  5. added
    editor-autoindent
    and removed
    editor-contrib
    on May 1, 2017
  6. removed their assignment
    on Sep 5, 2017
  7. alexdima commented on Aug 8, 2019

    @alexdima
    Member

    This works as expected when using "editor.useTabStops": false.

  8. locked and limited conversation to collaborators on Sep 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

editor-autoindentfeature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions