mirror of
				https://github.com/tmux/tmux.git
				synced 2025-11-04 09:44:18 +00:00 
			
		
		
		
	Sync OpenBSD patchset 427:
Don't redraw the scroll region on linefeed/reverse index unless it is necessary (the cursor is at the bottom/top). Should fix slow cursor movement when using vi in a pane spotted by pirofti@.
This commit is contained in:
		
							
								
								
									
										28
									
								
								tty.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								tty.c
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
/* $Id: tty.c,v 1.159 2009-10-23 17:22:39 tcunha Exp $ */
 | 
			
		||||
/* $Id: tty.c,v 1.160 2009-10-23 17:23:52 tcunha Exp $ */
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
 | 
			
		||||
@@ -689,20 +689,21 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
 | 
			
		||||
  	struct window_pane	*wp = ctx->wp;
 | 
			
		||||
	struct screen		*s = wp->screen;
 | 
			
		||||
 | 
			
		||||
	if (ctx->ocy != ctx->orupper)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
 	if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
 | 
			
		||||
	    !tty_term_has(tty->term, TTYC_CSR)) {
 | 
			
		||||
		tty_redraw_region(tty, ctx);
 | 
			
		||||
		return;
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	if (ctx->ocy == ctx->orupper) {
 | 
			
		||||
		tty_reset(tty);
 | 
			
		||||
	tty_reset(tty);
 | 
			
		||||
	
 | 
			
		||||
		tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
 | 
			
		||||
		tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper);
 | 
			
		||||
	tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
 | 
			
		||||
	tty_cursor_pane(tty, ctx, ctx->ocx, ctx->orupper);
 | 
			
		||||
	
 | 
			
		||||
		tty_putcode(tty, TTYC_RI);
 | 
			
		||||
	}
 | 
			
		||||
	tty_putcode(tty, TTYC_RI);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
@@ -711,6 +712,9 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
 | 
			
		||||
  	struct window_pane	*wp = ctx->wp;
 | 
			
		||||
	struct screen		*s = wp->screen;
 | 
			
		||||
 | 
			
		||||
	if (ctx->ocy != ctx->orlower)
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
 	if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
 | 
			
		||||
	    !tty_term_has(tty->term, TTYC_CSR)) {
 | 
			
		||||
		tty_redraw_region(tty, ctx);
 | 
			
		||||
@@ -725,14 +729,12 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
 | 
			
		||||
	if (ctx->num && !(tty->term->flags & TERM_EARLYWRAP))
 | 
			
		||||
		return;
 | 
			
		||||
 | 
			
		||||
	if (ctx->ocy == ctx->orlower) {
 | 
			
		||||
		tty_reset(tty);
 | 
			
		||||
	tty_reset(tty);
 | 
			
		||||
	
 | 
			
		||||
		tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
 | 
			
		||||
		tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
 | 
			
		||||
	tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
 | 
			
		||||
	tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
 | 
			
		||||
	
 | 
			
		||||
		tty_putc(tty, '\n');
 | 
			
		||||
	}
 | 
			
		||||
	tty_putc(tty, '\n');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user