mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 14:13:43 +01:00
also trigger autocomplete if last character is backslash
This commit is contained in:
+2
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user