فهرست منبع

Merge pull request #787 from sharelatex/ns-autocomplete-w-escaped-percent

still trigger autocomplete if % is escaped
James Allen 8 سال پیش
والد
کامیت
3546e842b0
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

+ 1 - 1
services/web/public/coffee/ide/editor/directives/aceEditor/auto-complete/AutoCompleteManager.coffee

@@ -162,7 +162,7 @@ define [
 			cursorPosition = @editor.getCursorPosition()
 			cursorPosition = @editor.getCursorPosition()
 			end = change.end
 			end = change.end
 			{lineUpToCursor, commandFragment} = Helpers.getContext(@editor, end)
 			{lineUpToCursor, commandFragment} = Helpers.getContext(@editor, end)
-			if lineUpToCursor.match(/.*%.*/)
+			if (i = lineUpToCursor.indexOf('%') > -1 and lineUpToCursor[i-1] != '\\')
 				return
 				return
 			lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
 			lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
 			lastTwoChars = lineUpToCursor.slice(-2)
 			lastTwoChars = lineUpToCursor.slice(-2)