summaryrefslogtreecommitdiffstats
path: root/src/channel.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-09-02 16:28:36 +0200
committerBram Moolenaar <Bram@vim.org>2017-09-02 16:28:36 +0200
commitef68e4fa528165f8dd63156feeffc1af629b8d8a (patch)
tree14d8384050c19d4279c316b3fcd43e82ba942734 /src/channel.c
parent3346cc4ffb459ecddb97a8c19bcc5834afa4dead (diff)
patch 8.0.1035: sending buffer lines to terminal doesn't work on MS-Windowsv8.0.1035
Problem: Sending buffer lines to terminal doesn't work on MS-Windows. Solution: Use CR instead of NL after every line. Make the EOF text work properly. Add the ++eof argument to :terminal.
Diffstat (limited to 'src/channel.c')
-rw-r--r--src/channel.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/channel.c b/src/channel.c
index 94a762c610..5a7e2a7301 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1300,11 +1300,16 @@ write_buf_line(buf_T *buf, linenr_T lnum, channel_T *channel)
return;
memcpy((char *)p, (char *)line, len);
- for (i = 0; i < len; ++i)
- if (p[i] == NL)
- p[i] = NUL;
+ if (channel->ch_write_text_mode)
+ p[len] = CAR;
+ else
+ {
+ for (i = 0; i < len; ++i)
+ if (p[i] == NL)
+ p[i] = NUL;
- p[len] = NL;
+ p[len] = NL;
+ }
p[len + 1] = NUL;
channel_send(channel, PART_IN, p, len + 1, "write_buf_line");
vim_free(p);