]> granicus.if.org Git - vim/commitdiff
patch 7.4.1902 v7.4.1902
authorBram Moolenaar <Bram@vim.org>
Sun, 5 Jun 2016 14:10:57 +0000 (16:10 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 5 Jun 2016 14:10:57 +0000 (16:10 +0200)
Problem:    No test for collapsing buffers for a channel.  Some text is lost.
Solution:   Add a simple test.  Set rq_buflen correctly.

src/channel.c
src/testdir/test_channel.vim
src/testdir/test_channel_pipe.py
src/version.c

index ae894704ceaf85281dea76a34dd139d6ea1ccca4..e60d49e4cf1afcbfcb5818acafe12f506ad119cf 100644 (file)
@@ -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; )
index a60147bd444de0940aa02668ed0bc49a0a17326a..d65e528b7bf07fae171d264710e5eb683eb9e324 100644 (file)
@@ -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
index 5f32506741bbaba903281604d5f084d31e5ba0d0..639cc6c2669713a5bd41bc3f7a1406de6a7472e1 100644 (file)
@@ -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()
index 4226b863d1f676464a9fd9ce4cf4624b55af617f..bfdc826b88aad7f1c31f390ed1b79aa3d786e9ea 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1902,
 /**/
     1901,
 /**/