From 829595777cbfc22e976ad965d1fa45163b0a3c64 Mon Sep 17 00:00:00 2001 From: Nate Stemen Date: Tue, 24 Oct 2017 16:35:28 +0100 Subject: [PATCH] change regex to match single backslash and command fragment --- .../aceEditor/auto-complete/AutoCompleteManager.coffee | 1 + .../editor/directives/aceEditor/auto-complete/Helpers.coffee | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee index 24a524b4b6..7ee46206d5 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee @@ -229,6 +229,7 @@ define [ 99999 ) ) + if lineBeyondCursor if partialCommandMatch = lineBeyondCursor.match(/^([a-z0-9]+)\{/) # We've got a partial command after the cursor diff --git a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Helpers.coffee b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Helpers.coffee index 7beb41debd..c3d5ef56ba 100644 --- a/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Helpers.coffee +++ b/services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/Helpers.coffee @@ -17,8 +17,8 @@ define [ # \includegraphics[width=\textwidth]{.. # should not match the \textwidth. blankArguments = lineUpToCursor.replace /\[([^\]]*)\]/g, (args) -> - Array(args.length+1).join('.') - if m = blankArguments.match(/(\\[^\\]+)$/) + Array(args.length + 1).join('.') + if m = blankArguments.match(/(\\[^\\]*)$/) return m.index else return -1