summaryrefslogtreecommitdiffstats
path: root/input.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2009-08-07 00:12:13 +0000
committerNicholas Marriott <nicm@openbsd.org>2009-08-07 00:12:13 +0000
commit04e97e8aefa722b7a0941a70889afc7e50c24035 (patch)
treed52204d63e12052b6a854a0c94b31942be512615 /input.c
parent746fe5832a428ac8d74f17c1d463805e51bee0c3 (diff)
Using the alternative screen (smcup/rmcup) should also preserve the current
colours and attributes. Found thanks to a report from Taylor Venable. While here also nuke a couple of extra blank lines.
Diffstat (limited to 'input.c')
-rw-r--r--input.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/input.c b/input.c
index e3bba5d3..4cba6e06 100644
--- a/input.c
+++ b/input.c
@@ -1189,7 +1189,9 @@ input_handle_sequence_sm(struct input_ctx *ictx)
wp->saved_grid, 0, s->grid, screen_hsize(s), sy);
wp->saved_cx = s->cx;
wp->saved_cy = s->cy;
-
+ memcpy(&wp->saved_cell,
+ &ictx->cell, sizeof wp->saved_cell);
+
grid_view_clear(s->grid, 0, 0, sx, sy);
wp->base.grid->flags &= ~GRID_HISTORY;
@@ -1261,7 +1263,7 @@ input_handle_sequence_rm(struct input_ctx *ictx)
if (sy > wp->saved_grid->sy)
screen_resize(s, sx, wp->saved_grid->sy);
- /* Restore the grid and cursor position. */
+ /* Restore the grid, cursor position and cell. */
grid_duplicate_lines(
s->grid, screen_hsize(s), wp->saved_grid, 0, sy);
s->cx = wp->saved_cx;
@@ -1270,6 +1272,7 @@ input_handle_sequence_rm(struct input_ctx *ictx)
s->cy = wp->saved_cy;
if (s->cy > screen_size_y(s) - 1)
s->cy = screen_size_y(s) - 1;
+ memcpy(&ictx->cell, &wp->saved_cell, sizeof ictx->cell);
/*
* Turn history back on (so resize can use it) and then
@@ -1326,7 +1329,6 @@ input_handle_sequence_dsr(struct input_ctx *ictx)
break;
}
}
-
}
void