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

still trigger autocomplete if % is escaped
This commit is contained in:
James Allen 2018-08-09 10:50:17 +01:00 committed by GitHub
commit 3546e842b0

View file

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