diff src/channel.c @ 8477:c08c6d19db4d v7.4.1529

commit https://github.com/vim/vim/commit/29fd03878c41526a586d77b3f3cd7938d26297af Author: Bram Moolenaar <Bram@vim.org> Date: Wed Mar 9 23:14:07 2016 +0100 patch 7.4.1529 Problem: Specifying buffer number for channel not implemented yet. Solution: Implement passing a buffer number.
author Christian Brabandt <cb@256bit.org>
date Wed, 09 Mar 2016 23:15:05 +0100
parents ade1797aa6f4
children 8924d7adbc22
line wrap: on
line diff
--- a/src/channel.c
+++ b/src/channel.c
@@ -987,7 +987,11 @@ channel_set_options(channel_T *channel, 
 	/* writing output to a buffer. Default mode is NL. */
 	if (!(opt->jo_set & JO_OUT_MODE))
 	    channel->ch_part[PART_OUT].ch_mode = MODE_NL;
-	channel->ch_part[PART_OUT].ch_buffer =
+	if (opt->jo_set & JO_OUT_BUF)
+	    channel->ch_part[PART_OUT].ch_buffer =
+				     buflist_findnr(opt->jo_io_buf[PART_OUT]);
+	else
+	    channel->ch_part[PART_OUT].ch_buffer =
 				find_buffer(opt->jo_io_name[PART_OUT], FALSE);
 	ch_logs(channel, "writing out to buffer '%s'",
 		      (char *)channel->ch_part[PART_OUT].ch_buffer->b_ffname);
@@ -1003,6 +1007,9 @@ channel_set_options(channel_T *channel, 
 	if (opt->jo_io[PART_ERR] == JIO_OUT)
 	    channel->ch_part[PART_ERR].ch_buffer =
 					 channel->ch_part[PART_OUT].ch_buffer;
+	else if (opt->jo_set & JO_ERR_BUF)
+	    channel->ch_part[PART_ERR].ch_buffer =
+				     buflist_findnr(opt->jo_io_buf[PART_ERR]);
 	else
 	    channel->ch_part[PART_ERR].ch_buffer =
 				 find_buffer(opt->jo_io_name[PART_ERR], TRUE);