Merge pull request #348 from Tass/isServing

added isServing parameter
This commit is contained in:
Araq 2013-02-27 15:53:44 -08:00
commit c0201b8d4a
4 changed files with 4 additions and 3 deletions

View file

@ -559,6 +559,7 @@ proc MainCommand =
wantMainModule() wantMainModule()
CommandSuggest() CommandSuggest()
of "serve": of "serve":
isServing = true
gGlobalOptions.incl(optCaasEnabled) gGlobalOptions.incl(optCaasEnabled)
msgs.gErrorMax = high(int) # do not stop after first error msgs.gErrorMax = high(int) # do not stop after first error
serve(MainCommand) serve(MainCommand)

View file

@ -523,8 +523,8 @@ proc SuggestWriteln*(s: string) =
stdoutSocket.send(s & "\c\L") stdoutSocket.send(s & "\c\L")
proc SuggestQuit*() = proc SuggestQuit*() =
if isNil(stdoutSocket): quit(0) if not isServing: quit(0)
else: elif not isNil(stdoutSocket):
stdoutSocket.send("\c\L") stdoutSocket.send("\c\L")
raise newException(ESuggestDone, "suggest done") raise newException(ESuggestDone, "suggest done")

View file

@ -105,6 +105,7 @@ var
gEvalExpr* = "" # expression for idetools --eval gEvalExpr* = "" # expression for idetools --eval
gLastCmdTime*: float # when caas is enabled, we measure each command gLastCmdTime*: float # when caas is enabled, we measure each command
gListFullPaths*: bool gListFullPaths*: bool
isServing*: bool = false
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools} proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc

View file

@ -90,4 +90,3 @@ proc serve*(action: proc (){.nimcall.}) =
else: else:
echo "Invalid server.type:", typ echo "Invalid server.type:", typ
quit 1 quit 1