get rid of confusing regex

This commit is contained in:
Nate Stemen 2018-08-07 09:49:50 -04:00
parent 2dcd2339ed
commit c26a85c02c

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)