diff options
author | bptato <nincsnevem662@gmail.com> | 2023-05-16 13:17:41 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-05-16 13:18:47 +0200 |
commit | 4e0fd8c7ef2ad2f61c1ac0572e02b92b1c42b688 (patch) | |
tree | 83adafc3a2046bb8af09d7c57340dc9374eebbd6 /src/ips | |
parent | 951d587f7edf3544d30ba039530a1d19b7e9db78 (diff) | |
download | chawan-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.nim | 4 | ||||
-rw-r--r-- | src/ips/forkserver.nim | 8 | ||||
-rw-r--r-- | src/ips/serialize.nim | 2 |
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) |