diff options
author | 2018-09-25 14:27:20 +0000 | |
---|---|---|
committer | 2018-09-25 14:27:20 +0000 | |
commit | 5fce8fa7e9a2a5faffd4d89ffeca7333a136db3f (patch) | |
tree | 3e2e24f4763515f4c6c1698dffb4380fdfe7ea80 /usr.bin/tmux/tty.c | |
parent | sync (diff) | |
download | wireguard-openbsd-5fce8fa7e9a2a5faffd4d89ffeca7333a136db3f.tar.xz wireguard-openbsd-5fce8fa7e9a2a5faffd4d89ffeca7333a136db3f.zip |
Allow panes to be 1 line or column by redrawing instead of using the
scroll region, from Soeren Tempel in GitHub issue 1487.
Diffstat (limited to 'usr.bin/tmux/tty.c')
-rw-r--r-- | usr.bin/tmux/tty.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 1fb1551de9a..754614b27de 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.306 2018/09/11 17:31:01 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.307 2018/09/25 14:27:20 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -1145,7 +1145,9 @@ tty_cmd_insertline(struct tty *tty, const struct tty_ctx *ctx) if (!tty_pane_full_width(tty, ctx) || tty_fake_bce(tty, ctx->wp, ctx->bg) || !tty_term_has(tty->term, TTYC_CSR) || - !tty_term_has(tty->term, TTYC_IL1)) { + !tty_term_has(tty->term, TTYC_IL1) || + ctx->wp->sx == 1 || + ctx->wp->sy == 1) { tty_redraw_region(tty, ctx); return; } @@ -1166,7 +1168,9 @@ tty_cmd_deleteline(struct tty *tty, const struct tty_ctx *ctx) if (!tty_pane_full_width(tty, ctx) || tty_fake_bce(tty, ctx->wp, ctx->bg) || !tty_term_has(tty->term, TTYC_CSR) || - !tty_term_has(tty->term, TTYC_DL1)) { + !tty_term_has(tty->term, TTYC_DL1) || + ctx->wp->sx == 1 || + ctx->wp->sy == 1) { tty_redraw_region(tty, ctx); return; } @@ -1227,7 +1231,9 @@ tty_cmd_reverseindex(struct tty *tty, const struct tty_ctx *ctx) if (!tty_pane_full_width(tty, ctx) || tty_fake_bce(tty, wp, 8) || !tty_term_has(tty->term, TTYC_CSR) || - !tty_term_has(tty->term, TTYC_RI)) { + !tty_term_has(tty->term, TTYC_RI) || + ctx->wp->sx == 1 || + ctx->wp->sy == 1) { tty_redraw_region(tty, ctx); return; } @@ -1251,7 +1257,9 @@ tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx) if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || - !tty_term_has(tty->term, TTYC_CSR)) { + !tty_term_has(tty->term, TTYC_CSR) || + wp->sx == 1 || + wp->sy == 1) { tty_redraw_region(tty, ctx); return; } @@ -1287,7 +1295,9 @@ tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx) if ((!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) || tty_fake_bce(tty, wp, 8) || - !tty_term_has(tty->term, TTYC_CSR)) { + !tty_term_has(tty->term, TTYC_CSR) || + wp->sx == 1 || + wp->sy == 1) { tty_redraw_region(tty, ctx); return; } |