Hello,

this patch removes an obsolete tty_cmd_linefeed function in tmux.

It seems tty_cmd_linefeed function was used last time in:
Author: nicm <n...@openbsd.org>
Date:   Wed Feb 8 17:31:09 2017 +0000

    Add support for scroll up escape sequence (CSI S) and use it when
    possible instead of sending individual line feeds.

Namely here (filtered with grep -C3):
<snip>
                screen_write_collect_scroll(ctx);
-               screen_write_initctx(ctx, &ttyctx);
-               tty_write(tty_cmd_linefeed, &ttyctx);
+               ctx->scrolled++;
</snip>

Grepping the tmux directory with tty_cmd_linefeed reveals two hits, one in
tmux.h and an another in tty.c which implements that.
Both are addressed in the following patch.

diff --git tmux.h tmux.h
index 6d901cecc72..44ed64d13f0 100644
--- tmux.h
+++ tmux.h
@@ -1734,7 +1734,6 @@ void    tty_cmd_deleteline(struct tty *, const
struct tty_ctx *);
 void    tty_cmd_erasecharacter(struct tty *, const struct tty_ctx *);
 void    tty_cmd_insertcharacter(struct tty *, const struct tty_ctx *);
 void    tty_cmd_insertline(struct tty *, const struct tty_ctx *);
-void    tty_cmd_linefeed(struct tty *, const struct tty_ctx *);
 void    tty_cmd_scrollup(struct tty *, const struct tty_ctx *);
 void    tty_cmd_reverseindex(struct tty *, const struct tty_ctx *);
 void    tty_cmd_setselection(struct tty *, const struct tty_ctx *);
diff --git tty.c tty.c
index 75ba0e1dec8..75b390a2c0f 100644
--- tty.c
+++ tty.c
@@ -1553,47 +1553,6 @@ tty_cmd_reverseindex(struct tty *tty, const
struct tty_ctx *ctx)
     tty_putcode(tty, TTYC_RI);
 }

-void
-tty_cmd_linefeed(struct tty *tty, const struct tty_ctx *ctx)
-{
-    struct window_pane    *wp = ctx->wp;
-
-    if (ctx->ocy != ctx->orlower)
-        return;
-
-    if (ctx->bigger ||
-        (!tty_pane_full_width(tty, ctx) && !tty_use_margin(tty)) ||
-        tty_fake_bce(tty, wp, 8) ||
-        !tty_term_has(tty->term, TTYC_CSR) ||
-        wp->sx == 1 ||
-        wp->sy == 1) {
-        tty_redraw_region(tty, ctx);
-        return;
-    }
-
-    tty_default_attributes(tty, wp, ctx->bg);
-
-    tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower);
-    tty_margin_pane(tty, ctx);
-
-    /*
-     * If we want to wrap a pane while using margins, the cursor needs to
-     * be exactly on the right of the region. If the cursor is entirely off
-     * the edge - move it back to the right. Some terminals are funny about
-     * this and insert extra spaces, so only use the right if margins are
-     * enabled.
-     */
-    if (ctx->xoff + ctx->ocx > tty->rright) {
-        if (!tty_use_margin(tty))
-            tty_cursor(tty, 0, ctx->yoff + ctx->ocy);
-        else
-            tty_cursor(tty, tty->rright, ctx->yoff + ctx->ocy);
-    } else
-        tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy);
-
-    tty_putc(tty, '\n');
-}
-
 void
 tty_cmd_scrollup(struct tty *tty, const struct tty_ctx *ctx)
 {

--
Kind regards,
Ville Valkonen

Reply via email to