From: Mike Lowis Date: Mon, 10 Oct 2016 17:12:06 +0000 (-0400) Subject: Fixed loading of buffer contents from stdin X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=f241ae68e33155cd91956243ea216620ccbad1bb;p=projs%2Ftide.git Fixed loading of buffer contents from stdin --- diff --git a/buf.c b/buf.c index b32d69a..91c6892 100644 --- a/buf.c +++ b/buf.c @@ -62,7 +62,10 @@ static void binsave(Buf* buf, FILE* file) { void buf_load(Buf* buf, char* path) { buf->insert_mode = true; if (!strcmp(path,"-")) { - buf_ins(buf, 0, (Rune)'\n'); + buf->charset = UTF_8; + Rune r; + while (RUNE_EOF != (r = fgetrune(stdin))) + buf_ins(buf, buf_end(&Buffer), r); } else { FMap file = fmap(path); buf->path = strdup(path);