We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
DEBUG_TEX
1 parent 0a84aed commit 61302a8Copy full SHA for 61302a8
src/latexdsl/tex_daemon.nim
@@ -1,5 +1,8 @@
1
import std / [osproc, streams, strutils, strscans]
2
3
+from std / os import getEnv
4
+var DebugTexDaemon = getEnv("DEBUG_TEX", "false").parseBool
5
+
6
type
7
TeXDaemon* = object
8
isReady*: bool
@@ -9,6 +12,8 @@ type
9
12
10
13
proc write*(d: TeXDaemon, line: string) =
11
14
if d.pid.running:
15
+ if DebugTexDaemon:
16
+ echo "Writing: ", line
17
d.stdin.write(line & "\n")
18
d.stdin.flush()
19
else:
@@ -24,6 +29,8 @@ proc read*(d: TeXDaemon): string =
24
29
c = d.stdout.readChar()
25
30
data.add c
26
31
result = data
32
33
+ echo "Read: ", result
27
34
28
35
raise newException(IOError, "The TeXDaemon is not running anymore. Reading failed.")
36
0 commit comments