summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-06-05 16:10:57 +0200
committerBram Moolenaar <Bram@vim.org>2016-06-05 16:10:57 +0200
commitbbe8d91e695184771d7e45315258fab8eb3e6b07 (patch)
tree8e28c096028bb762529910c9bbf5203318945134
parent762f1754370a1278167c8cba6c047ef319fc099c (diff)
downloadvim-bbe8d91e695184771d7e45315258fab8eb3e6b07.zip
patch 7.4.1902
Problem: No test for collapsing buffers for a channel. Some text is lost. Solution: Add a simple test. Set rq_buflen correctly.
-rw-r--r--src/channel.c1
-rw-r--r--src/testdir/test_channel.vim3
-rw-r--r--src/testdir/test_channel_pipe.py10
-rw-r--r--src/version.c2
4 files changed, 16 insertions, 0 deletions
diff --git a/src/channel.c b/src/channel.c
index ae894704c..e60d49e4c 100644
--- a/src/channel.c
+++ b/src/channel.c
@@ -1657,6 +1657,7 @@ channel_collapse(channel_T *channel, int part, int want_nl)
p += n->rq_buflen;
vim_free(n->rq_buffer);
}
+ node->rq_buflen = (long_u)(p - newbuf);
/* dispose of the collapsed nodes and their buffers */
for (n = node->rq_next; n != last_node; )
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index a60147bd4..d65e528b7 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -538,6 +538,9 @@ func Test_nl_pipe()
call assert_equal("this", ch_readraw(handle))
call assert_equal("AND this", ch_readraw(handle))
+ call ch_sendraw(handle, "split this line\n")
+ call assert_equal("this linethis linethis line", ch_readraw(handle))
+
let reply = ch_evalraw(handle, "quit\n")
call assert_equal("Goodbye!", reply)
finally
diff --git a/src/testdir/test_channel_pipe.py b/src/testdir/test_channel_pipe.py
index 5f3250674..639cc6c26 100644
--- a/src/testdir/test_channel_pipe.py
+++ b/src/testdir/test_channel_pipe.py
@@ -6,6 +6,7 @@
from __future__ import print_function
import sys
+import time
if __name__ == "__main__":
@@ -31,6 +32,15 @@ if __name__ == "__main__":
if typed.startswith("double "):
print(typed[7:-1] + "\nAND " + typed[7:-1])
sys.stdout.flush()
+ if typed.startswith("split "):
+ print(typed[6:-1], end='')
+ sys.stdout.flush()
+ time.sleep(0.05)
+ print(typed[6:-1], end='')
+ sys.stdout.flush()
+ time.sleep(0.05)
+ print(typed[6:-1])
+ sys.stdout.flush()
if typed.startswith("echoerr "):
print(typed[8:-1], file=sys.stderr)
sys.stderr.flush()
diff --git a/src/version.c b/src/version.c
index 4226b863d..bfdc826b8 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1902,
+/**/
1901,
/**/
1900,