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

Tab insert spaces in the end of line

Open asfernandes opened this issue 4 years ago • 2 comments

I'm in the end of a line and press tab but it inserts spaces.

The file is configured to use tab as indentation, so in this case it should insert tabs as the original behavior.

asfernandes avatar Mar 15 '20 15:03 asfernandes

Tabs indent, spaces align. As such, pressing tab in a line anywhere after a non-tab character (including other whitespace characters such as a space) inserts spaces (alignment) rather than a tab (indentation), since indentation only exists at the start of a line.

I just verified that the plugin does correctly insert tabs at the end of a line preceded solely by other tabs. Are there any non-tab characters in the line when you press tab at the end?

j-zeppenfeld avatar Mar 15 '20 21:03 j-zeppenfeld

Then I misunderstood the extension. I starter using it because I have typescript files indented with tabs bug there I have multiline backticked sql strings that is indented with spaces. And the extension works great when I press enter inside of one string, the next line starts correct (first with the tabs, then spaces as the line where I pressed enter).

I want my typescript file to use tabs (not only in the first characters of each line).

I need that tab insert tab when I press it becase I use a tab before // when commenting.

asfernandes avatar Mar 16 '20 00:03 asfernandes