Просмотр исходного кода

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

autocomplete escaped % issue
Alasdair Smith 8 лет назад
Родитель
Сommit
8f4fe5ec67

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

@@ -162,7 +162,8 @@ 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 (i = lineUpToCursor.indexOf('%') > -1 and lineUpToCursor[i-1] != '\\')
+			if ((i = lineUpToCursor.indexOf('%')) > -1 and lineUpToCursor[i-1] != '\\')
+				console.log lineUpToCursor, i
 				return
 				return
 			lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
 			lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
 			lastTwoChars = lineUpToCursor.slice(-2)
 			lastTwoChars = lineUpToCursor.slice(-2)