From bb3c5e7a3464b242917d4947af19c81c2d74050a Mon Sep 17 00:00:00 2001 From: Shane Kilkelly Date: Fri, 30 Jun 2017 15:05:21 +0100 Subject: [PATCH] Reverse direction, don't ignore commands in comments --- .../aceEditor/auto-complete/SuggestionManager.coffee | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee index dc54373ca6..97241a90ce 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/SuggestionManager.coffee +++ b/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: () ->