Skip to content

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

Closed

Description

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

Activity

  1. SamVerschueren commented on Feb 9, 2016

    @SamVerschueren
    Contributor
  2. nchammas commented on Feb 9, 2016

    @nchammas

    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.

  3. philipgiuliani commented on Feb 9, 2016

    @philipgiuliani
    Author

    Nicholas Chammas (@nchammas) Thats the following issue i think #2829

  4. nchammas commented on Feb 9, 2016

    @nchammas

    Oh, good catch!

  5. mbroadst commented on Feb 10, 2016

    @mbroadst

    +1, seeing this as well

  6. alexdima commented on Feb 10, 2016

    @alexdima
    Member

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

  7. SamVerschueren commented on Feb 10, 2016

    @SamVerschueren
    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 :).

  8. mbroadst commented on Feb 10, 2016

    @mbroadst

    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
    }
    
  9. SamVerschueren commented on Feb 10, 2016

    @SamVerschueren
    Contributor
  10. alexdima commented on Feb 10, 2016

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

  11. locked and limited conversation to collaborators on Nov 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions