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

[0.10.8] Indentation adds a tab on the beginning #2845

Closed
philipgiuliani opened this issue Feb 9, 2016 · 10 comments
Closed

[0.10.8] Indentation adds a tab on the beginning #2845

philipgiuliani opened this issue Feb 9, 2016 · 10 comments

Comments

@philipgiuliani
Copy link

Steps to reproduce 100%:

  1. Enable "files.trimTrailingWhitespace": true
  2. Create a .js file
  3. Indent somewhere in a function, move the cursor to another line and save the file so that the whitespace gets trimmed.
  4. Go back to that line and press TAB. indentation

Here two examples of what is happening:

indentation_v2
indentation

@SamVerschueren
Copy link
Contributor

//cc @bpasero @alexandrudima

@nchammas
Copy link

nchammas commented Feb 9, 2016

I'm seeing a potentially related issue with SQL files if I highlight some lines and try to indent them with tab.

screen recording 2016-02-09 at 03 27 pm

This one is strange because, in addition to killing all the text, Command + Z refuses to undo the action!

If I manually indent the first line with 4 spaces and highlight the rest, hitting tab works as expected.

@philipgiuliani
Copy link
Author

@nchammas Thats the following issue i think #2829

@nchammas
Copy link

nchammas commented Feb 9, 2016

Oh, good catch!

@mbroadst
Copy link

+1, seeing this as well

@alexdima
Copy link
Member

@mbroadst What OS are you on? I am trying to reproduce in #2829, so far unsuccessfully. Do you have other steps?

@SamVerschueren
Copy link
Contributor

@alexandrudima This bug seems only related in a file with insertSpaces set to true. In a file with tabs, this isn't an issue. Just so you know :).

@mbroadst
Copy link

@alexandrudima I'm on OSX, vscode version 0.10.8. I just tried to make a gif screen grab of the behavior, and couldn't reproduce it every time though. It seems almost random, and during my attempts I also ran into some weird indentation bug where after I saved the file, and then indented, it indented in the middle of the string randomly.

my user settings are:

{
  "javascript.validate.enable": false,
  "jshint.enable": true,
  "editor.renderWhitespace": true,
  "editor.insertSpaces": true,
  "editor.tabSize": 2,
  "files.trimTrailingWhitespace": true
}

@SamVerschueren
Copy link
Contributor

@mbroadst probably related to #2829

@alexdima
Copy link
Member

Indeed after investigating #2829 I can confirm this is a dup. We detect an extra tab was typed after pressing Tab in the case that the files dirty count increases from 0 to 1 in one VS Code window.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants