Selaa lähdekoodia

Reverse direction, don't ignore commands in comments

Shane Kilkelly 9 vuotta sitten
vanhempi
sitoutus
bb3c5e7a34

+ 3 - 6
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee

@@ -39,18 +39,15 @@ define [], () ->
 			return commands
 
 		# Ignore single letter commands since auto complete is moot then.
-		# Ignore commands which occur after a comment character '%'
-		commandRegex: /^([^%]*?)\\([a-zA-Z][a-zA-Z]+)/m
+		commandRegex: /\\([a-zA-Z][a-zA-Z]+)/
 
 		nextCommand: () ->
 			i = @doc.search(@commandRegex)
 			if i == -1
 				return false
 			else
-				matchObject = @doc.match(@commandRegex)
-				preMatch = matchObject[1]
-				match = matchObject[2]
-				@doc = @doc.substr(i + preMatch.length + match.length + 1)
+				match = @doc.match(@commandRegex)[1]
+				@doc = @doc.substr(i + match.length + 1)
 				return match
 
 		consumeWhitespace: () ->