mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
put a unique end of stream marker in the session dictionary
This commit is contained in:
parent
a655041bdd
commit
b684ed0837
1 changed files with 7 additions and 1 deletions
|
@ -45,6 +45,7 @@ class ASpellWorker
|
||||||
# receive the end of data marker
|
# receive the end of data marker
|
||||||
@state = 'busy'
|
@state = 'busy'
|
||||||
@callback = callback
|
@callback = callback
|
||||||
|
@setEndOfStreamMarker()
|
||||||
@setTerseMode()
|
@setTerseMode()
|
||||||
@write(words)
|
@write(words)
|
||||||
@flush()
|
@flush()
|
||||||
|
@ -60,7 +61,7 @@ class ASpellWorker
|
||||||
flush: () ->
|
flush: () ->
|
||||||
# get aspell to send an end of data marker "*" when ready
|
# get aspell to send an end of data marker "*" when ready
|
||||||
@sendCommand("%") # take the aspell pipe out of terse mode so we can look for a '*'
|
@sendCommand("%") # take the aspell pipe out of terse mode so we can look for a '*'
|
||||||
@sendCommand("end") # send a valid word ("end") so it will generate a '*'
|
@sendCommand("^ENDOFSTREAMMARKER") # send our marker which will generate a '*'
|
||||||
@sendCommand("!") # go back into terse mode
|
@sendCommand("!") # go back into terse mode
|
||||||
|
|
||||||
shutdown: (reason) ->
|
shutdown: (reason) ->
|
||||||
|
@ -68,6 +69,11 @@ class ASpellWorker
|
||||||
@state = "closing"
|
@state = "closing"
|
||||||
@pipe.stdin.end()
|
@pipe.stdin.end()
|
||||||
|
|
||||||
|
setEndOfStreamMarker: () ->
|
||||||
|
return if @setup
|
||||||
|
@sendCommand("@ENDOFSTREAMMARKER") # make this string a valid word
|
||||||
|
@setup = true
|
||||||
|
|
||||||
setTerseMode: () ->
|
setTerseMode: () ->
|
||||||
@sendCommand("!")
|
@sendCommand("!")
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue