mirror of
https://github.com/tmux/tmux.git
synced 2025-04-22 04:18:47 +00:00
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:
parent
683ddbc466
commit
9b5da97e6f
10
tty.c
10
tty.c
@ -684,13 +684,15 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
struct window_pane *wp = ctx->wp;
|
struct window_pane *wp = ctx->wp;
|
||||||
struct screen *s = wp->screen;
|
struct screen *s = wp->screen;
|
||||||
|
|
||||||
|
if (ctx->ocy != ctx->orupper)
|
||||||
|
return;
|
||||||
|
|
||||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||||
!tty_term_has(tty->term, TTYC_CSR)) {
|
!tty_term_has(tty->term, TTYC_CSR)) {
|
||||||
tty_redraw_region(tty, ctx);
|
tty_redraw_region(tty, ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ctx->ocy == ctx->orupper) {
|
|
||||||
tty_reset(tty);
|
tty_reset(tty);
|
||||||
|
|
||||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||||
@ -698,7 +700,6 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
|
|
||||||
tty_putcode(tty, TTYC_RI);
|
tty_putcode(tty, TTYC_RI);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
||||||
@ -706,6 +707,9 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
struct window_pane *wp = ctx->wp;
|
struct window_pane *wp = ctx->wp;
|
||||||
struct screen *s = wp->screen;
|
struct screen *s = wp->screen;
|
||||||
|
|
||||||
|
if (ctx->ocy != ctx->orlower)
|
||||||
|
return;
|
||||||
|
|
||||||
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
if (wp->xoff != 0 || screen_size_x(s) < tty->sx ||
|
||||||
!tty_term_has(tty->term, TTYC_CSR)) {
|
!tty_term_has(tty->term, TTYC_CSR)) {
|
||||||
tty_redraw_region(tty, ctx);
|
tty_redraw_region(tty, ctx);
|
||||||
@ -720,7 +724,6 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
if (ctx->num && !(tty->term->flags & TERM_EARLYWRAP))
|
if (ctx->num && !(tty->term->flags & TERM_EARLYWRAP))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (ctx->ocy == ctx->orlower) {
|
|
||||||
tty_reset(tty);
|
tty_reset(tty);
|
||||||
|
|
||||||
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
|
||||||
@ -728,7 +731,6 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
|
|||||||
|
|
||||||
tty_putc(tty, '\n');
|
tty_putc(tty, '\n');
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
tty_cmd_clearendofscreen(struct tty *tty, const struct tty_ctx *ctx)
|
||||||
|
Loading…
Reference in New Issue
Block a user