Răsfoiți Sursa

Merge pull request #77 from sharelatex/ns-autocomplete-insertion-bug

fix autocomplete insertion on single backslash; Fixes #55
Alasdair Smith 9 ani în urmă
părinte
comite
1a8a915116

+ 1 - 0
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-zA-Z0-9]+)\{/)
 											# We've got a partial command after the cursor

+ 2 - 2
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