mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge branch 'sk-ac-disable-for-existing-environments' into sk-ac-improvements-integration
This commit is contained in:
commit
98f96d6087
1 changed files with 6 additions and 0 deletions
|
@ -12,6 +12,9 @@ define [
|
||||||
else
|
else
|
||||||
return null
|
return null
|
||||||
|
|
||||||
|
getCommandNameFromFragment = (commandFragment) ->
|
||||||
|
commandFragment?.match(/\\(\w+)\{/)?[1]
|
||||||
|
|
||||||
class AutoCompleteManager
|
class AutoCompleteManager
|
||||||
constructor: (@$scope, @editor, @element, @labelsManager) ->
|
constructor: (@$scope, @editor, @element, @labelsManager) ->
|
||||||
@suggestionManager = new SuggestionManager()
|
@suggestionManager = new SuggestionManager()
|
||||||
|
@ -124,6 +127,9 @@ define [
|
||||||
if lineUpToCursor.match(/.*%.*/)
|
if lineUpToCursor.match(/.*%.*/)
|
||||||
return
|
return
|
||||||
commandFragment = getLastCommandFragment(lineUpToCursor)
|
commandFragment = getLastCommandFragment(lineUpToCursor)
|
||||||
|
commandName = getCommandNameFromFragment(commandFragment)
|
||||||
|
if commandName in ['begin', 'end']
|
||||||
|
return
|
||||||
# Check that this change was made by us, not a collaborator
|
# Check that this change was made by us, not a collaborator
|
||||||
# (Cursor is still one place behind)
|
# (Cursor is still one place behind)
|
||||||
# NOTE: this is also the case when a user backspaces over a highlighted region
|
# NOTE: this is also the case when a user backspaces over a highlighted region
|
||||||
|
|
Loading…
Reference in a new issue