tab-indent-space-align icon indicating copy to clipboard operation
tab-indent-space-align copied to clipboard

Can't insert tabs after spaces

Open JaneSmith opened this issue 5 months ago • 2 comments

It seems this extension assumes that tabs are only valid before other characters. If you have a non-tab character, then you cannot insert further tabs on the line. I don't believe this behaviour is entirely correct.

Here's my simplified example scenario:

____var x = foo({
____........____bar
____........});

In the above, tabs are represented by _ and spaces are represented by ..

The problem is on the middle line:

  1. First we use tabs for indentation, to match indentation with the current block (i.e. the first line).

  2. Then we use spaces for alignment, as we want to align with the above line, matching a certain number of characters until we reach the indentation point for the nested block.

  3. Finally, we want to indent at this point, using a tab stop. The extension makes this impossible, as it inserts spaces instead.

Am I missing something?

(Perhaps not the best example now I think of it, as you might just do a simple one-level indentation here without any alignment — but I do keep running into more complicated cases where I want to do it like this.)

JaneSmith avatar Sep 16 '24 00:09 JaneSmith