mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-03 16:46:18 +00:00 
			
		
		
		
	Fix two errors with character/line insertion and deletion: the maximum number
of characters which may be inserted or deleted is the screen width, not one less (and similarly for lines and height); and if characters or lines are deleted by moving the ones that follow, the space at the end needs to be cleared. This appears to solve long-standing redraw issues most visible when using the force-width option then scrolling in view(1) or unwrapping lines in emacs.
This commit is contained in:
		@@ -325,8 +325,8 @@ screen_write_insertcharacter(struct screen_write_ctx *ctx, u_int nx)
 | 
			
		||||
	if (nx == 0)
 | 
			
		||||
		nx = 1;
 | 
			
		||||
 | 
			
		||||
	if (nx > screen_size_x(s) - 1 - s->cx)
 | 
			
		||||
		nx = screen_size_x(s) - 1 - s->cx;
 | 
			
		||||
	if (nx > screen_size_x(s) - s->cx)
 | 
			
		||||
		nx = screen_size_x(s) - s->cx;
 | 
			
		||||
	if (nx == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -347,8 +347,8 @@ screen_write_deletecharacter(struct screen_write_ctx *ctx, u_int nx)
 | 
			
		||||
	if (nx == 0)
 | 
			
		||||
		nx = 1;
 | 
			
		||||
 | 
			
		||||
	if (nx > screen_size_x(s) - 1 - s->cx)
 | 
			
		||||
		nx = screen_size_x(s) - 1 - s->cx;
 | 
			
		||||
	if (nx > screen_size_x(s) - s->cx)
 | 
			
		||||
		nx = screen_size_x(s) - s->cx;
 | 
			
		||||
	if (nx == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -369,8 +369,8 @@ screen_write_insertline(struct screen_write_ctx *ctx, u_int ny)
 | 
			
		||||
	if (ny == 0)
 | 
			
		||||
		ny = 1;
 | 
			
		||||
 | 
			
		||||
	if (ny > screen_size_y(s) - 1 - s->cy)
 | 
			
		||||
		ny = screen_size_y(s) - 1 - s->cy;
 | 
			
		||||
	if (ny > screen_size_y(s) - s->cy)
 | 
			
		||||
		ny = screen_size_y(s) - s->cy;
 | 
			
		||||
	if (ny == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
@@ -395,8 +395,8 @@ screen_write_deleteline(struct screen_write_ctx *ctx, u_int ny)
 | 
			
		||||
	if (ny == 0)
 | 
			
		||||
		ny = 1;
 | 
			
		||||
 | 
			
		||||
	if (ny > screen_size_y(s) - 1 - s->cy)
 | 
			
		||||
		ny = screen_size_y(s) - 1 - s->cy;
 | 
			
		||||
	if (ny > screen_size_y(s) - s->cy)
 | 
			
		||||
		ny = screen_size_y(s) - s->cy;
 | 
			
		||||
	if (ny == 0)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user