mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
prevent spell check from running twice on doc load
This commit is contained in:
parent
908926a0cc
commit
a2f99bc04f
1 changed files with 3 additions and 3 deletions
|
@ -19,7 +19,7 @@ define [
|
|||
@runCheckOnChange(e)
|
||||
|
||||
@editor.on "changeSession", (e) =>
|
||||
@runFullCheck()
|
||||
@runSpellCheckSoon(200)
|
||||
|
||||
e.oldSession?.getDocument().off "change", onChange
|
||||
e.session.getDocument().on "change", onChange
|
||||
|
@ -100,14 +100,14 @@ define [
|
|||
end: cursor
|
||||
return highlight
|
||||
|
||||
runSpellCheckSoon: () ->
|
||||
runSpellCheckSoon: (delay = 1000) ->
|
||||
run = () =>
|
||||
delete @timeoutId
|
||||
@runSpellCheck(@updatedLines)
|
||||
@updatedLines = []
|
||||
if @timeoutId?
|
||||
clearTimeout @timeoutId
|
||||
@timeoutId = setTimeout run, 1000
|
||||
@timeoutId = setTimeout run, delay
|
||||
|
||||
markLinesAsUpdated: (change) ->
|
||||
start = change.range.start
|
||||
|
|
Loading…
Reference in a new issue