mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
Don't trigger autocomplete when editing existing environment
This commit is contained in:
parent
b73b78e570
commit
da286438be
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,9 @@ define [
|
|||
else
|
||||
return null
|
||||
|
||||
getCommandNameFromFragment = (commandFragment) ->
|
||||
commandFragment?.match(/\\(\w+)\{/)?[1]
|
||||
|
||||
class AutoCompleteManager
|
||||
constructor: (@$scope, @editor, @element, @labelsManager) ->
|
||||
@suggestionManager = new SuggestionManager()
|
||||
|
@ -122,6 +125,9 @@ define [
|
|||
range = new Range(end.row, 0, end.row, end.column)
|
||||
lineUpToCursor = @editor.getSession().getTextRange(range)
|
||||
commandFragment = getLastCommandFragment(lineUpToCursor)
|
||||
commandName = getCommandNameFromFragment(commandFragment)
|
||||
if commandName in ['begin', 'end']
|
||||
return
|
||||
# Check that this change was made by us, not a collaborator
|
||||
# (Cursor is still one place behind)
|
||||
# NOTE: this is also the case when a user backspaces over a highlighted region
|
||||
|
|
Loading…
Reference in a new issue