version 1.232, 2017/02/07 18:27:46 |
version 1.233, 2017/02/08 08:50:10 |
|
|
return; |
return; |
} |
} |
|
|
/* |
|
* If this line wrapped naturally (ctx->num is nonzero) and we are not |
|
* using margins, don't do anything - the cursor can just be moved |
|
* to the last cell and wrap naturally. |
|
*/ |
|
if ((!tty_use_margin(tty) || |
|
tty_pane_full_width(tty, ctx)) && |
|
ctx->num != 0 && |
|
!(tty->term->flags & TERM_EARLYWRAP)) |
|
return; |
|
|
|
tty_attributes(tty, &grid_default_cell, wp); |
tty_attributes(tty, &grid_default_cell, wp); |
|
|
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); |
tty_region_pane(tty, ctx, ctx->orupper, ctx->orlower); |
|
|
tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx) |
tty_cmd_cell(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; |
|
u_int cx, width; |
|
|
|
if (ctx->xoff + ctx->ocx > tty->sx - 1 && ctx->ocy == ctx->orlower) { |
if (ctx->xoff + ctx->ocx > tty->sx - 1 && ctx->ocy == ctx->orlower) { |
if (tty_pane_full_width(tty, ctx)) |
if (tty_pane_full_width(tty, ctx)) |
|
|
tty_margin_off(tty); |
tty_margin_off(tty); |
} |
} |
|
|
/* Is the cursor in the very last position? */ |
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); |
width = ctx->cell->data.width; |
|
if (ctx->ocx > wp->sx - width) { |
|
if (!tty_pane_full_width(tty, ctx)) { |
|
/* |
|
* The pane doesn't fill the entire line, the linefeed |
|
* will already have happened, so just move the cursor. |
|
*/ |
|
if (ctx->ocy != wp->yoff + wp->screen->rlower) |
|
tty_cursor_pane(tty, ctx, 0, ctx->ocy + 1); |
|
else |
|
tty_cursor_pane(tty, ctx, 0, ctx->ocy); |
|
} else if (tty->cy != ctx->yoff + ctx->ocy || |
|
tty->cx < tty->sx) { |
|
/* |
|
* The cursor isn't in the last position already, so |
|
* move as far right as possible and redraw the last |
|
* cell to move into the last position. |
|
*/ |
|
cx = screen_size_x(s) - ctx->last_cell.data.width; |
|
tty_cursor_pane(tty, ctx, cx, ctx->ocy); |
|
tty_cell(tty, &ctx->last_cell, wp); |
|
} |
|
} else |
|
tty_cursor_pane(tty, ctx, ctx->ocx, ctx->ocy); |
|
|
|
tty_cell(tty, ctx->cell, wp); |
tty_cell(tty, ctx->cell, wp); |
} |
} |