Skip to content

Indenting multiple lines using Tab fails #2829

Closed

Description

I wanted to indent multiple lines at once but it failed. This is how it looks like when I select some lines and press Tab. Sometimes it works though, like when creating an untitled file in split screen.

indent

Quite important bug Erich Gamma (@egamma) Johannes Rieken (@jrieken) Benjamin Pasero (@bpasero)

Activity

  1. added
    bug
    important
    on Feb 9, 2016
  2. bpasero commented on Feb 9, 2016

    @bpasero
    Contributor
  3. philipgiuliani commented on Feb 9, 2016

    @philipgiuliani

    Same here! Cant work with it currently! It also intents completly wrong when i create a newline. (With a tab instead of spaces also...)

  4. SamVerschueren commented on Feb 9, 2016

    @SamVerschueren
    ContributorAuthor

    It also intents completly wrong when i create a newline. (With a tab instead of spaces also...)

    That's something else and was introduced in the previous version as well. If editor.insertSpaces is set to auto it detects the indentation used by the opened file. But if you create a new file, it can't detect the indentation type so it uses spaces instead. Some issues regarding this have been raised already and should be discussed over there. Here it is: #1747

  5. rhires commented on Feb 9, 2016

    @rhires

    This looks like Mac OS behavior for the select before the editor knows that the select requires different behavior. It's just not catching that first select. Once the file is in the working files section then the editor has it in memory...this is me speculating, though, and watching what is happening.

  6. philipgiuliani commented on Feb 9, 2016

    @philipgiuliani

    Can somebody provide a link for VSCode 0.10.6? Its impossible to work on HTML with this Version. Hope to have it fixed soon.

    Sam Verschueren (@SamVerschueren)
    What i mean is the following. (Extension .jsx, file is not empty, it has 70 lines)
    This behaviour was definetly not present before.

    Steps to reproduce:

    1. .jsx file (maybe also other ones)
    2. Indent somewhere in a function, move the cursor to another line and save the file (be sure to have "remove leading whitespace" option enabled)
    3. Go back to that line and press TAB.

    indentation

  7. SamVerschueren commented on Feb 9, 2016

    @SamVerschueren
    ContributorAuthor

    Philip Giuliani (@philipgiuliani) Ok, that's definitely something else. Create a new issue for that one if you don't mind as it's not the same as this one and then they can separately being tracked by the team.

  8. philipgiuliani commented on Feb 9, 2016

    @philipgiuliani

    Sam Verschueren (@SamVerschueren) Thank you! Done in the following issue #2845.

  9. nchammas commented on Feb 9, 2016

    @nchammas

    Having a similar 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.

  10. alexdima commented on Feb 10, 2016

    @alexdima
    Member

    Sam Verschueren (@SamVerschueren) Philip Giuliani (@philipgiuliani) Nicholas Chammas (@nchammas) I am sorry, this looks horrible.

    I cannot reproduce on a vanilla (no extensions) 0.10.8 on Windows.
    tab-sql

    tab-text

    I will try shortly on the mac

  11. SamVerschueren commented on Feb 10, 2016

    @SamVerschueren
    ContributorAuthor

    Indeed, might be related to Mac.

  12. alexdima commented on Feb 10, 2016

    @alexdima
    Member

    Sam Verschueren (@SamVerschueren) Do you have any extensions installed that might hijack the tab key? i.e. just to be sure the built-in command executes, can you please add the following to the end of your keybindings.json:

    { "key": "tab", "command": "tab", "when": "editorTextFocus && !editorTabMovesFocus" }
    
  13. 24 remaining items

  14. brunnopleffken commented on Feb 17, 2016

    @brunnopleffken
    Contributor

    I'm also experiencing this behavior when pressing SHIFT+TAB.
    All the selected block of code is deleted and CMD+Z (undo) doesn't work at all.

    OS X El Capitan 10.11.3
    VS Code 0.10.8-insider

  15. philipgiuliani commented on Feb 17, 2016

    @philipgiuliani
  16. added a commit that references this issue on Feb 17, 2016
    b8e7046
  17. weinand commented on Feb 17, 2016

    @weinand
    Contributor

    alexandrudima I've verified fix for the insider's build.

  18. joaomoreno commented on Feb 17, 2016

    @joaomoreno
    Contributor

    alexandrudima looks great for stable too

  19. brunnopleffken commented on Feb 17, 2016

    @brunnopleffken
    Contributor

    Philip Giuliani (@philipgiuliani) Oops! Mistyping an issue may cause situations like this, HAHAHAHA

  20. changed the title [-][0.10.8] What's wrong with the indentation?[/-] [+][0.10.8] Indenting multiple lines using Tab fails[/+] on Feb 17, 2016
  21. changed the title [-][0.10.8] Indenting multiple lines using Tab fails[/-] [+]Indenting multiple lines using Tab fails[/+] on Feb 17, 2016
  22. yo1dog commented on Feb 18, 2016

    @yo1dog

    Just want to say thanks for the workarounds and the fixed update today. :)

  23. ElChupacabra26 commented on Feb 18, 2016

    @ElChupacabra26

    👍 +1 to that

  24. SamVerschueren commented on Feb 19, 2016

    @SamVerschueren
    ContributorAuthor

    Thanks alexandrudima . Appreciate the effort!

  25. priyank2005 commented on Feb 20, 2016

    @priyank2005

    Thanks for fixing this

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

Labels

bugimportantverified

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions