From 1b0d261d54fa908e7ea229649a60b8a2e35d08fc Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 4 Apr 2020 10:15:50 -0400 Subject: [PATCH] JavaScript Highlighter: Fix array whitespace --- MongoView/Synax Highlighting/JavaScriptHighlighter.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/MongoView/Synax Highlighting/JavaScriptHighlighter.swift b/MongoView/Synax Highlighting/JavaScriptHighlighter.swift index d201cff..a8a4c91 100644 --- a/MongoView/Synax Highlighting/JavaScriptHighlighter.swift +++ b/MongoView/Synax Highlighting/JavaScriptHighlighter.swift @@ -289,7 +289,7 @@ class JavaScriptHighlighter { indent += " " array: while currentIndex < text.endIndex && peek() != "]" { - print("Array element") + consumeWhitespace() while currentIndex < text.endIndex { if peek() == "," { consume() // , @@ -300,6 +300,7 @@ class JavaScriptHighlighter { break array } else { indent += " " + print("Array element") consumeExpression() indent = String(indent.dropLast(2)) }