Don't autocomplete for commands like \\, \[, \:, etc

This commit is contained in:
Shane Kilkelly 2017-07-14 13:52:18 +01:00
parent f66982dd8b
commit 70e5279ba2

View file

@ -128,9 +128,9 @@ define [
if lineUpToCursor.match(/.*%.*/)
return
lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
lastTwoCharsAreBackslash = lineUpToCursor.slice(-2) == "\\\\"
# Don't offer autocomplete on double-backslash
if lastTwoCharsAreBackslash
lastTwoChars = lineUpToCursor.slice(-2)
# Don't offer autocomplete on double-backslash, backslash-colon, etc
if lastTwoChars.match(/^\\[^a-z]$/)
@editor?.completer?.detach?()
return
commandFragment = getLastCommandFragment(lineUpToCursor)