From: Michael D. Lowis Date: Tue, 18 Jul 2017 20:11:09 +0000 (-0400) Subject: fixed a bug when executing 'Send' on multi-line chunks X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=741a51f51331a9764cc4a2b4670b5718d3ccda4e;p=projs%2Ftide.git fixed a bug when executing 'Send' on multi-line chunks --- diff --git a/lib/pty.c b/lib/pty.c index 73e3864..d783d9c 100644 --- a/lib/pty.c +++ b/lib/pty.c @@ -53,7 +53,8 @@ void pty_spawn(char** argv) { void pty_send(char* str) { if (!str) return; view_eof(win_view(EDIT), false); - bool has_eol = (str[strlen(str)-1] == '\n'); + size_t sz = strlen(str); + bool has_eol = (str[sz-1] == '\n'); while (*str) { Rune rune = 0; size_t length = 0; @@ -74,6 +75,7 @@ void pty_send_rune(Rune rune) { if (write(PtyFD, str, strlen(str)-1) < 0) PtyFD = -1; free(str); + win_buf(EDIT)->outpoint = pos; } }