Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-line indents do not preserve partial indents #15598

Closed
lewisl9029 opened this issue Nov 16, 2016 · 4 comments
Closed

Multi-line indents do not preserve partial indents #15598

lewisl9029 opened this issue Nov 16, 2016 · 4 comments
Assignees
Labels
editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality
Milestone

Comments

@lewisl9029
Copy link

lewisl9029 commented Nov 16, 2016

  • 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.

@normalser
Copy link

Something similar: #9409

@ramya-rao-a
Copy link
Contributor

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

@alexdima
Copy link
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.

@alexdima alexdima added feature-request Request for new features or functionality editor-contrib Editor collection of extras labels Nov 30, 2016
@alexdima alexdima added this to the Backlog milestone Nov 30, 2016
@alexdima alexdima removed their assignment Nov 30, 2016
@rebornix rebornix added editor-autoindent Editor auto indentation issues and removed editor-contrib Editor collection of extras labels May 1, 2017
@rebornix rebornix self-assigned this May 1, 2017
@rebornix rebornix removed their assignment Sep 5, 2017
@alexdima
Copy link
Member

alexdima commented Aug 8, 2019

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

@alexdima alexdima closed this as completed Aug 8, 2019
@alexdima alexdima self-assigned this Aug 8, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Sep 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
editor-autoindent Editor auto indentation issues feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants