mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Only include actual trailing spaces not unused cells with capturep -J,
from George Nachman.
This commit is contained in:
		
							
								
								
									
										6
									
								
								grid.c
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								grid.c
									
									
									
									
									
								
							@@ -592,6 +592,7 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
 | 
				
			|||||||
	char			*buf, code[128];
 | 
						char			*buf, code[128];
 | 
				
			||||||
	size_t			 len, off, size, codelen;
 | 
						size_t			 len, off, size, codelen;
 | 
				
			||||||
	u_int			 xx;
 | 
						u_int			 xx;
 | 
				
			||||||
 | 
						const struct grid_line	*gl;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
						GRID_DEBUG(gd, "px=%u, py=%u, nx=%u", px, py, nx);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -604,8 +605,11 @@ grid_string_cells(struct grid *gd, u_int px, u_int py, u_int nx,
 | 
				
			|||||||
	buf = xmalloc(len);
 | 
						buf = xmalloc(len);
 | 
				
			||||||
	off = 0;
 | 
						off = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						gl = grid_peek_line(gd, py);
 | 
				
			||||||
	for (xx = px; xx < px + nx; xx++) {
 | 
						for (xx = px; xx < px + nx; xx++) {
 | 
				
			||||||
		gc = grid_peek_cell(gd, xx, py);
 | 
							if (gl == NULL || xx >= gl->cellsize)
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							gc = &gl->celldata[xx];
 | 
				
			||||||
		if (gc->flags & GRID_FLAG_PADDING)
 | 
							if (gc->flags & GRID_FLAG_PADDING)
 | 
				
			||||||
			continue;
 | 
								continue;
 | 
				
			||||||
		grid_cell_get(gc, &ud);
 | 
							grid_cell_get(gc, &ud);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user