mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Update commentary
This commit is contained in:
parent
da84b3f31c
commit
1f3a375b4e
1 changed files with 3 additions and 2 deletions
|
@ -125,6 +125,7 @@ define [
|
|||
end = change.end
|
||||
# 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
|
||||
if end.row == cursorPosition.row and end.column == cursorPosition.column + 1
|
||||
if change.action == "insert"
|
||||
range = new Range(end.row, 0, end.row, end.column)
|
||||
|
@ -134,16 +135,16 @@ define [
|
|||
if commandFragment? and commandFragment.length > 2
|
||||
if commandFragment.startsWith('\\label{')
|
||||
# console.log ">> LABEL IS HERE"
|
||||
# TODO: trigger re-scan of document
|
||||
@labelsManager.scheduleLoadLabelsFromOpenDoc()
|
||||
setTimeout () =>
|
||||
@editor.execCommand("startAutocomplete")
|
||||
, 0
|
||||
else
|
||||
# Check if user has backspaced/deleted a highlighted region of text
|
||||
# and see if that contains a `\label{}`
|
||||
if change.action == 'remove'
|
||||
if _.any(change.lines, (line) -> line.match(/\\label{.*}/))
|
||||
# console.log ">> a label has been removed"
|
||||
# TODO: trigger removal of label
|
||||
@labelsManager.scheduleLoadLabelsFromOpenDoc()
|
||||
|
||||
monkeyPatchAutocomplete: () ->
|
||||
|
|
Loading…
Reference in a new issue