mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Squash a function that is only called in a callback into the callback
function.
This commit is contained in:
		
							
								
								
									
										31
									
								
								window.c
									
									
									
									
									
								
							
							
						
						
									
										31
									
								
								window.c
									
									
									
									
									
								
							@@ -586,9 +586,19 @@ window_pane_spawn(struct window_pane *wp, const char *cmd, const char *shell,
 | 
			
		||||
void
 | 
			
		||||
window_pane_read_callback(unused struct bufferevent *bufev, void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct window_pane *wp = data;
 | 
			
		||||
	struct window_pane     *wp = data;
 | 
			
		||||
	char   		       *new_data;
 | 
			
		||||
	size_t			new_size;
 | 
			
		||||
 | 
			
		||||
	window_pane_parse(wp);
 | 
			
		||||
	new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off;
 | 
			
		||||
	if (wp->pipe_fd != -1 && new_size > 0) {
 | 
			
		||||
		new_data = EVBUFFER_DATA(wp->event->input);
 | 
			
		||||
		bufferevent_write(wp->pipe_event, new_data, new_size);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	input_parse(wp);
 | 
			
		||||
 | 
			
		||||
	wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/* ARGSUSED */
 | 
			
		||||
@@ -726,23 +736,6 @@ window_pane_reset_mode(struct window_pane *wp)
 | 
			
		||||
	wp->flags |= PANE_REDRAW;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
window_pane_parse(struct window_pane *wp)
 | 
			
		||||
{
 | 
			
		||||
	char   *data;
 | 
			
		||||
	size_t	new_size;
 | 
			
		||||
 | 
			
		||||
	new_size = EVBUFFER_LENGTH(wp->event->input) - wp->pipe_off;
 | 
			
		||||
	if (wp->pipe_fd != -1 && new_size > 0) {
 | 
			
		||||
		data = EVBUFFER_DATA(wp->event->input);
 | 
			
		||||
		bufferevent_write(wp->pipe_event, data, new_size);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	input_parse(wp);
 | 
			
		||||
 | 
			
		||||
	wp->pipe_off = EVBUFFER_LENGTH(wp->event->input);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
window_pane_key(struct window_pane *wp, struct client *c, int key)
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user