about summary refs log tree commit diff stats
path: root/src/ips
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-05-16 13:17:41 +0200
committerbptato <nincsnevem662@gmail.com>2023-05-16 13:18:47 +0200
commit4e0fd8c7ef2ad2f61c1ac0572e02b92b1c42b688 (patch)
tree83adafc3a2046bb8af09d7c57340dc9374eebbd6 /src/ips
parent951d587f7edf3544d30ba039530a1d19b7e9db78 (diff)
downloadchawan-4e0fd8c7ef2ad2f61c1ac0572e02b92b1c42b688.tar.gz
Refactor config, add charset opts
Only document-charset supported for now.
Diffstat (limited to 'src/ips')
-rw-r--r--src/ips/editor.nim4
-rw-r--r--src/ips/forkserver.nim8
-rw-r--r--src/ips/serialize.nim2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/ips/editor.nim b/src/ips/editor.nim
index 4361c39f..0e2c91c8 100644
--- a/src/ips/editor.nim
+++ b/src/ips/editor.nim
@@ -30,7 +30,7 @@ func formatEditorName(editor, file: string, line: int): string =
     result &= file
 
 proc openEditor*(term: Terminal, config: Config, file: string, line = 1): bool =
-  var editor = config.editor
+  var editor = config.external.editor
   if editor == "":
     editor = getEnv("EDITOR")
     if editor == "":
@@ -43,7 +43,7 @@ proc openEditor*(term: Terminal, config: Config, file: string, line = 1): bool =
 var tmpf_seq: int
 proc openInEditor*(term: Terminal, config: Config, input: var string): bool =
   try:
-    let tmpdir = config.tmpdir
+    let tmpdir = config.external.tmpdir
     if not dirExists(tmpdir):
       createDir(tmpdir)
     var tmpf = tmpdir / "chatmp" & $tmpf_seq
diff --git a/src/ips/forkserver.nim b/src/ips/forkserver.nim
index 009c5491..e7ddf1c0 100644
--- a/src/ips/forkserver.nim
+++ b/src/ips/forkserver.nim
@@ -75,8 +75,8 @@ proc forkLoader(ctx: var ForkServerContext, config: LoaderConfig): Pid =
       let e = getCurrentException()
       # taken from system/excpt.nim
       let msg = e.getStackTrace() & "Error: unhandled exception: " & e.msg &
-        " [" & $e.name & "]"
-      eprint(msg)
+        " [" & $e.name & "]\n"
+      stderr.write(msg)
     doAssert false
   let readfd = pipefd[0] # get read
   discard close(pipefd[1]) # close write
@@ -121,8 +121,8 @@ proc forkBuffer(ctx: var ForkServerContext): Pid =
       let e = getCurrentException()
       # taken from system/excpt.nim
       let msg = e.getStackTrace() & "Error: unhandled exception: " & e.msg &
-        " [" & $e.name & "]"
-      eprint(msg)
+        " [" & $e.name & "]\n"
+      stderr.write(msg)
     doAssert false
   ctx.children.add((pid, loaderPid))
   return pid
diff --git a/src/ips/serialize.nim b/src/ips/serialize.nim
index b8ffab0a..0636e2e9 100644
--- a/src/ips/serialize.nim
+++ b/src/ips/serialize.nim
@@ -325,6 +325,7 @@ proc swrite*(stream: Stream, source: BufferSource) =
   of LOAD_PIPE: stream.swrite(source.fd)
   stream.swrite(source.location)
   stream.swrite(source.contenttype)
+  stream.swrite(source.charset)
 
 proc sread*(stream: Stream, source: var BufferSource) =
   var t: BufferSourceType
@@ -341,6 +342,7 @@ proc sread*(stream: Stream, source: var BufferSource) =
     stream.sread(source.fd)
   stream.sread(source.location)
   stream.sread(source.contenttype)
+  stream.sread(source.charset)
 
 func slen*(source: BufferSource): int =
   result += slen(source.t)
Kartik K. Agaram <vc@akkartik.com> 2015-05-25 22:27:19 -0700 committer Kartik K. Agaram <vc@akkartik.com> 2015-05-25 22:27:19 -0700 1459' href='/akkartik/mu/commit/html/031address.cc.html?h=main&id=c5ffb6e1cc9c5ff880d037c53b8ebc8562be0008'>c5ffb6e1 ^
672e3e50 ^
















65361948 ^
672e3e50 ^


c5ffb6e1 ^
672e3e50 ^




c5ffb6e1 ^

672e3e50 ^
65361948 ^

672e3e50 ^


65361948 ^
672e3e50 ^






65361948 ^



672e3e50 ^
672e3e50 ^



65361948 ^



672e3e50 ^
672e3e50 ^







65361948 ^



672e3e50 ^
c5ffb6e1 ^
672e3e50 ^







c5ffb6e1 ^
65361948 ^
672e3e50 ^




c5ffb6e1 ^
65361948 ^

672e3e50 ^






1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155