You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines) #2938
Depending on how my cursor arrives at line of code determines which way the editor indents the line. Let me start by showing what the correct indent spacing looks like:
If I am on a line of code and there is already a space on the line, which is invisible if the line is selected, indents to the first indent spot encountered.
If I am on a line of code, lose focus of VS Code, and then come back to VS Code the indent spacing is incorrect and its a combination of tabs and spaces.
If you enable to show invisible spaces, they are still not visible on the current line selected. I think it would be useful to be able to see them as well.
It may be useful stating that this weird spacing is occurring while working with typescript. I am not sure if it occurs for any other languages. And please let me know if I am missing a configuration item.
If you enable to show invisible spaces, they are still not visible on
the current line selected. I think it would be useful to be able to see
them as well.
It may be useful stating that this weird spacing is occurring while
working with typescript. I am not sure if it occurs for any other
languages. And please let me know if I am missing a configuration item.
Thanks!
—
Reply to this email directly or view it on GitHub #2938.
Alex Mamut (@amamut) Is it possible you hit #2829 (i.e. if you try one of the workarounds is this reproducible?). Otherwise (if this still occurs after applying one of the workarounds), can you please share your settings? (i.e. do you use formatOnType)
alexandrudima I do not use formatOnType. So workaround #1 fixed the weird combination tab and space indenting. The culprit could be "files.autoSave": "onFocusChange" as the workaround made me comment this line out.
However it did not fix the single space on a line bug where it indents to the first indent spot encountered.
It may be useful to add that I am also using OSX El Capitan 10.11.3.
changed the title [-]Indent spacing inconsistent[/-][+]When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)[/+]on Mar 17, 2016
Christof Marti (@chrmarti) I would consider this a separate thing. Mostly, the indentation adds whitespace, in this case it would need to delete whitespace which it never did so far. Let's track your request in #11322
Activity
roslanr18 commentedon Feb 11, 2016
[email protected]
On Feb 11, 2016 10:51 PM, "Alex Mamut" [email protected] wrote:
alexdima commentedon Feb 12, 2016
Alex Mamut (@amamut) Is it possible you hit #2829 (i.e. if you try one of the workarounds is this reproducible?). Otherwise (if this still occurs after applying one of the workarounds), can you please share your settings? (i.e. do you use formatOnType)
amamut commentedon Feb 12, 2016
alexandrudima I do not use formatOnType. So workaround #1 fixed the weird combination tab and space indenting. The culprit could be
"files.autoSave": "onFocusChange"as the workaround made me comment this line out.However it did not fix the single space on a line bug where it indents to the first indent spot encountered.
It may be useful to add that I am also using OSX El Capitan 10.11.3.
alexdima commentedon Feb 12, 2016
Alex Mamut (@amamut) Indeed, only empty lines get indented straight to the right place -- https://github.com/Microsoft/vscode/blob/master/src/vs/editor/common/controller/oneCursor.ts#L1284
I can enhance that logic to also do it for whitespace only lines.
amamut commentedon Feb 12, 2016
alexandrudima I feel that would make the most sense.
[-]Indent spacing inconsistent[/-][+]When pressing Tab on white-space only lines, indent straight to the right spot (similar to empty lines)[/+]chrmarti commentedon Jul 28, 2016
Works, except when there is already the full indentation (or more) on the line. It would make sense to make it work the same way in that case:
egamma commentedon Jul 29, 2016
This is makes sense, but not critical enough for July. Moving to August.
alexdima commentedon Aug 31, 2016
Christof Marti (@chrmarti) I would consider this a separate thing. Mostly, the indentation adds whitespace, in this case it would need to delete whitespace which it never did so far. Let's track your request in #11322
Fixes microsoft#2938: Indent straight to the correct place for whites…