j-zeppenfeld / tab-indent-space-align

A Visual Studio Code extension for those who know the difference between indentation and alignment.
MIT License
17 stars 1 forks source link

Tab insert spaces in the end of line #4

Open asfernandes opened 4 years ago

asfernandes commented 4 years ago

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.

j-zeppenfeld commented 4 years ago

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?

asfernandes commented 4 years ago

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.