mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-15 15:37:36 +00:00
also trigger autocomplete if last character is backslash
This commit is contained in:
parent
c9678ad699
commit
69796bd835
1 changed files with 2 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue