also trigger autocomplete if last character is backslash

This commit is contained in:
Shane Kilkelly 2017-06-28 15:48:21 +01:00
parent c9678ad699
commit 69796bd835

View file

@ -121,6 +121,7 @@ define [
end = change.end
range = new Range(end.row, 0, end.row, end.column)
lineUpToCursor = @editor.getSession().getTextRange(range)
lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"
commandFragment = getLastCommandFragment(lineUpToCursor)
# Check that this change was made by us, not a collaborator
# (Cursor is still one place behind)
@ -130,7 +131,7 @@ define [
end.row == cursorPosition.row and
end.column == cursorPosition.column + 1
)
if commandFragment? and commandFragment.length > 2
if (commandFragment? and commandFragment.length > 2) or lastCharIsBackslash
setTimeout () =>
@editor.execCommand("startAutocomplete")
, 0