Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 39270cc

Browse files
author
Antonio Scandurra
authored
Merge pull request #650 from atom/as-ns/fix-auto-indent
Fix auto-indent when the previous line ends with a comment with a quote
2 parents 12b321b + 4076f4e commit 39270cc

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

settings/language-javascript.cson

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
'commentStart': '// '
55
'foldEndPattern': '^\\s*\\}|^\\s*\\]|^\\s*\\)'
66
'increaseIndentPattern': '(?x)
7-
\\{ [^}"\']* $
8-
| \\[ [^\\]"\']* $
9-
| \\( [^)"\']* $
7+
\\{ [^}"\']*(//.*)? $
8+
| \\[ [^\\]"\']*(//.*)? $
9+
| \\( [^)"\']*(//.*)? $
1010
'
1111
'decreaseIndentPattern': '(?x)
1212
^ \\s* (\\s* /[*] .* [*]/ \\s*)* [}\\])]

spec/javascript-spec.coffee

+3-3
Original file line numberDiff line numberDiff line change
@@ -2202,7 +2202,7 @@ describe "JavaScript grammar", ->
22022202
it "indents non-allman-style curly braces", ->
22032203
expectPreservedIndentation """
22042204
if (true) {
2205-
for (;;) {
2205+
for (;;) { // "
22062206
while (true) {
22072207
x();
22082208
}
@@ -2226,7 +2226,7 @@ describe "JavaScript grammar", ->
22262226

22272227
it "indents collection literals", ->
22282228
expectPreservedIndentation """
2229-
[
2229+
[ // "
22302230
{
22312231
a: b,
22322232
c: d
@@ -2239,7 +2239,7 @@ describe "JavaScript grammar", ->
22392239
it "indents function arguments", ->
22402240
expectPreservedIndentation """
22412241
f(
2242-
g(
2242+
g( // "
22432243
h,
22442244
i
22452245
),

0 commit comments

Comments
 (0)