[javascript mode] minor smart indentation glitch at multiple if else statements without braces #1436

Closed
opened 2013-04-06 20:41:04 +02:00 by marijnh · 1 comment
marijnh commented 2013-04-06 20:41:04 +02:00 (Migrated from gitlab.com)

The following statement is indented the wrong way when doing:

for (var i = 0; i <= mirror.lineCount(); i++) {
mirror.indentLine(i, "smart");
}

if (true) ____if (false) ________alert(1); else ____alert(2);

instead of

if (true) ____if (false) ________alert(1); ____else ________alert(2);

Keep up the good work... :)

The following statement is indented the wrong way when doing: for (var i = 0; i <= mirror.lineCount(); i++) { mirror.indentLine(i, "smart"); } `if (true) ____if (false) ________alert(1); else ____alert(2);` instead of `if (true) ____if (false) ________alert(1); ____else ________alert(2);` Keep up the good work... :)
marijnh commented 2013-04-06 20:48:13 +02:00 (Migrated from gitlab.com)

Oh, I forgot to mention that is behavior happens at CodeMirror 3.11 (and at least 2.36 too).

Oh, I forgot to mention that is behavior happens at CodeMirror 3.11 (and at least 2.36 too).
marijnh (Migrated from gitlab.com) closed this issue 2013-04-08 14:12:06 +02:00
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
codemirror/codemirror5#1436
No description provided.