diff src/channel.c @ 12311:66fa8eabbd6e v8.0.1035

patch 8.0.1035: sending buffer lines to terminal doesn't work on MS-Windows commit https://github.com/vim/vim/commit/ef68e4fa528165f8dd63156feeffc1af629b8d8a Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 2 16:28:36 2017 +0200 patch 8.0.1035: sending buffer lines to terminal doesn't work on MS-Windows 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.
author Christian Brabandt <cb@256bit.org>
date Sat, 02 Sep 2017 16:30:04 +0200
parents e1f44e4afe67
children 44f3c9b7eec4
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -1300,11 +1300,16 @@ write_buf_line(buf_T *buf, linenr_T lnum
 	return;
     memcpy((char *)p, (char *)line, len);
 
-    for (i = 0; i < len; ++i)
-	if (p[i] == NL)
-	    p[i] = NUL;
-
-    p[len] = NL;
+    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 + 1] = NUL;
     channel_send(channel, PART_IN, p, len + 1, "write_buf_line");
     vim_free(p);