Sync OpenBSD patchset 416:

Always move the cursor position on !xenl terminals, since there is no invisible
last cursor position.

Also nuke an unused variable.
This commit is contained in:
Tiago Cunha 2009-10-23 17:08:30 +00:00
parent 2e39ab59d7
commit 2f14ef61ff
2 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $Id: screen-write.c,v 1.79 2009-10-23 17:07:18 tcunha Exp $ */ /* $Id: screen-write.c,v 1.80 2009-10-23 17:08:30 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -990,7 +990,7 @@ screen_write_cell(
struct tty_ctx ttyctx; struct tty_ctx ttyctx;
struct grid_utf8 gu, *tmp_gu; struct grid_utf8 gu, *tmp_gu;
u_int width, xx, i; u_int width, xx, i;
struct grid_cell tmp_gc, tmp_gc2, *tmp_gcp; struct grid_cell tmp_gc, *tmp_gcp;
int insert = 0; int insert = 0;
/* Ignore padding. */ /* Ignore padding. */
@ -1101,13 +1101,13 @@ screen_write_cell(
} }
ttyctx.utf8 = &gu; ttyctx.utf8 = &gu;
if (screen_check_selection(s, s->cx - width, s->cy)) { if (screen_check_selection(s, s->cx - width, s->cy)) {
memcpy(&tmp_gc2, &s->sel.cell, sizeof tmp_gc2); memcpy(&tmp_gc, &s->sel.cell, sizeof tmp_gc);
tmp_gc2.data = gc->data; tmp_gc.data = gc->data;
tmp_gc2.flags = gc->flags & tmp_gc.flags = gc->flags &
~(GRID_FLAG_FG256|GRID_FLAG_BG256); ~(GRID_FLAG_FG256|GRID_FLAG_BG256);
tmp_gc2.flags |= s->sel.cell.flags & tmp_gc.flags |= s->sel.cell.flags &
(GRID_FLAG_FG256|GRID_FLAG_BG256); (GRID_FLAG_FG256|GRID_FLAG_BG256);
ttyctx.cell = &tmp_gc2; ttyctx.cell = &tmp_gc;
tty_write(tty_cmd_cell, &ttyctx); tty_write(tty_cmd_cell, &ttyctx);
} else { } else {
ttyctx.cell = gc; ttyctx.cell = gc;

5
tty.c
View File

@ -1,4 +1,4 @@
/* $Id: tty.c,v 1.154 2009-10-23 17:06:23 tcunha Exp $ */ /* $Id: tty.c,v 1.155 2009-10-23 17:08:30 tcunha Exp $ */
/* /*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -855,7 +855,8 @@ tty_cmd_cell(struct tty *tty, const struct tty_ctx *ctx)
* Should the cursor be in the last cursor position ready for a natural * Should the cursor be in the last cursor position ready for a natural
* wrap? If so - and it isn't - move to and rewrite the last cell. * wrap? If so - and it isn't - move to and rewrite the last cell.
*/ */
if (ctx->ocx + wp->xoff > tty->sx - ctx->last_width) { if (!(tty->term->flags & TERM_EARLYWRAP) &&
ctx->ocx + wp->xoff > tty->sx - ctx->last_width) {
if (tty->cx < tty->sx) { if (tty->cx < tty->sx) {
cx = screen_size_x(s) - ctx->last_width; cx = screen_size_x(s) - ctx->last_width;
tty_cursor_pane(tty, ctx, cx, ctx->ocy); tty_cursor_pane(tty, ctx, cx, ctx->ocy);