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

autocomplete escaped % issue
This commit is contained in:
Alasdair Smith 2018-08-13 09:46:38 +01:00 committed by GitHub
commit 8f4fe5ec67

View file

@ -162,7 +162,8 @@ define [
cursorPosition = @editor.getCursorPosition()
end = change.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
lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
lastTwoChars = lineUpToCursor.slice(-2)