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 }}
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
When a comment contains a quote character (' or ") on a line which should be followed by an additional level of indentation, all following lines are indented one level less than they should be.
Steps to Reproduce
In Atom, create a new Javascript file. (Optionally configure 1 indent = 4 spaces).
Write or paste code like the following:
if(firstBoolean) {
var myVar1 = "Indentation from the first conditional makes the issue more visible.";
if(secondBoolean) { //this comment has at least one "double-quote" character in it
var myVar2 = "This content and everything that follows is one indent level left of correct.";
return myvar2;
}
}
Select All.
Auto-indent.
Expected behavior:
Code formatted like the sample above.
Note that the close curly brace for the if (secondBoolean) is aligned with the if statement, and the contents of that conditional block are indented one level farther right.
Actual behavior:
if(firstBoolean) {
var myVar1 = "Indentation from the first conditional makes the issue more visible.";
if(secondBoolean) { //this comment has at least one "double-quote" character in it
var myVar2 = "This content and everything that follows is one indent level left of correct.";
return myvar2;
}
}
Note that everything after if(secondBoolean) is indented one level less than it should be, until the point when there is no further left the code can go.
Removing all quote characters and doing another auto-indent causes proper alignment. It does not appear to matter where in the comment the quote character appears. Even a quote character in a contraction will trigger the bug.
Reproduces how often:
Always, even in safe mode.
Versions
Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro
The text was updated successfully, but these errors were encountered:
Thanks agin for reporting @wbt ✌️ Reproduced with 1.37.0 on macOS 10.12.6.
As a side note, there's an open pull request to use Tree-sitter for indentation which may fix this issue if you want to subscribe there for updates: atom/atom#18321.
Description
When a comment contains a quote character (
'
or"
) on a line which should be followed by an additional level of indentation, all following lines are indented one level less than they should be.Steps to Reproduce
Expected behavior:
Code formatted like the sample above.
Note that the close curly brace for the
if (secondBoolean)
is aligned with the if statement, and the contents of that conditional block are indented one level farther right.Actual behavior:
Note that everything after
if(secondBoolean)
is indented one level less than it should be, until the point when there is no further left the code can go.Removing all quote characters and doing another auto-indent causes proper alignment. It does not appear to matter where in the comment the quote character appears. Even a quote character in a contraction will trigger the bug.
Reproduces how often:
Always, even in safe mode.
Versions
Atom : 1.23.2
Electron: 1.6.15
Chrome : 56.0.2924.87
Node : 7.4.0
Windows: 10 Pro
The text was updated successfully, but these errors were encountered: