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.
I am using Atom 1.23.2 x64 on the latest Windows 10, writing in Javascript in a file with a .js extension.
The code below, written as an illustrative example, is presented as Atom auto-indents it, with four spaces per indent for visual clarity:
Demonstration = {
function withoutMultiLineComment(param1, param2) {
var message = "";
if(param1>10) {
message = "This is big.";
if(param1>100) {
message += " It's huge.";
} else {
message += " But it's not huge.";
}
} else {
message = "This is not big.";
}
}
function withMultiLineComment(param1, param2) {
var message = "";
if(param1>10) {
message = "This is big.";
if(param1>100) {
message += " It's huge.";
/*
if (param1 == param2) {
message += " And it matches param2!";
} else {
message += " But it doesn't match param2!";
}
*/
} else {
message += " But it's not huge.";
}
} else {
message = "This is not big.";
}
}
//The negative indentation error suggest that additional code here is no longer
//a sub-block within Demonstration.
//If there are multiple such comments, the indentation errors accumulate quickly.
}
The function withoutMultiLineComment is indented as expected. The function withMultiLineComment bumps out two levels of indentation unexpectedly. The expected behavior is for the comment to not affect indentation.
The close curly brace inside the multiline comment is recognized by the autoindenter as the close of the code block beginning in non-commented code, even though placing the cursor directly before or after close braces in non-commented code show proper pairing between curly braces within non-commented code.
Code which is commented-out by a multiline comment should not be paired with non-commented code to decrease the level of indentation.
From @wbt on February 12, 2018 20:40
I am using Atom 1.23.2 x64 on the latest Windows 10, writing in Javascript in a file with a .js extension.
The code below, written as an illustrative example, is presented as Atom auto-indents it, with four spaces per indent for visual clarity:
The function
withoutMultiLineComment
is indented as expected. The functionwithMultiLineComment
bumps out two levels of indentation unexpectedly. The expected behavior is for the comment to not affect indentation.The close curly brace inside the multiline comment is recognized by the autoindenter as the close of the code block beginning in non-commented code, even though placing the cursor directly before or after close braces in non-commented code show proper pairing between curly braces within non-commented code.
Code which is commented-out by a multiline comment should not be paired with non-commented code to decrease the level of indentation.
Copied from original issue: atom/atom#16721
The text was updated successfully, but these errors were encountered: