mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:26:05 +00:00 
			
		
		
		
	Rework reflow code so it does not do so much allocation which should be
faster with large histories.
This commit is contained in:
		
							
								
								
									
										13
									
								
								screen.c
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								screen.c
									
									
									
									
									
								
							@@ -362,15 +362,10 @@ screen_check_selection(struct screen *s, u_int px, u_int py)
 | 
			
		||||
 | 
			
		||||
/* Reflow wrapped lines. */
 | 
			
		||||
void
 | 
			
		||||
screen_reflow(struct screen *s, u_int sx)
 | 
			
		||||
screen_reflow(struct screen *s, u_int new_x)
 | 
			
		||||
{
 | 
			
		||||
	struct grid	*old, *new;
 | 
			
		||||
	struct grid	*old = s->grid;
 | 
			
		||||
 | 
			
		||||
	old = s->grid;
 | 
			
		||||
	new = grid_create(old->sx, old->sy, old->hlimit);
 | 
			
		||||
 | 
			
		||||
	s->cy -= grid_reflow(new, old, sx);
 | 
			
		||||
	s->grid = new;
 | 
			
		||||
 | 
			
		||||
	grid_destroy(old);
 | 
			
		||||
	s->grid = grid_create(old->sx, old->sy, old->hlimit);
 | 
			
		||||
	s->cy -= grid_reflow(s->grid, old, new_x);
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user