version 1.86, 2012/10/26 14:35:42 |
version 1.87, 2012/11/27 20:08:42 |
|
|
* history is not updated |
* history is not updated |
*/ |
*/ |
void |
void |
window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc) |
window_pane_alternate_on(struct window_pane *wp, struct grid_cell *gc, |
|
int cursor) |
{ |
{ |
struct screen *s = &wp->base; |
struct screen *s = &wp->base; |
u_int sx, sy; |
u_int sx, sy; |
|
|
|
|
wp->saved_grid = grid_create(sx, sy, 0); |
wp->saved_grid = grid_create(sx, sy, 0); |
grid_duplicate_lines(wp->saved_grid, 0, s->grid, screen_hsize(s), sy); |
grid_duplicate_lines(wp->saved_grid, 0, s->grid, screen_hsize(s), sy); |
wp->saved_cx = s->cx; |
if (cursor) { |
wp->saved_cy = s->cy; |
wp->saved_cx = s->cx; |
|
wp->saved_cy = s->cy; |
|
} |
memcpy(&wp->saved_cell, gc, sizeof wp->saved_cell); |
memcpy(&wp->saved_cell, gc, sizeof wp->saved_cell); |
|
|
grid_view_clear(s->grid, 0, 0, sx, sy); |
grid_view_clear(s->grid, 0, 0, sx, sy); |
|
|
|
|
/* Exit alternate screen mode and restore the copied grid. */ |
/* Exit alternate screen mode and restore the copied grid. */ |
void |
void |
window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc) |
window_pane_alternate_off(struct window_pane *wp, struct grid_cell *gc, |
|
int cursor) |
{ |
{ |
struct screen *s = &wp->base; |
struct screen *s = &wp->base; |
u_int sx, sy; |
u_int sx, sy; |
|
|
|
|
/* Restore the grid, cursor position and cell. */ |
/* Restore the grid, cursor position and cell. */ |
grid_duplicate_lines(s->grid, screen_hsize(s), wp->saved_grid, 0, sy); |
grid_duplicate_lines(s->grid, screen_hsize(s), wp->saved_grid, 0, sy); |
s->cx = wp->saved_cx; |
if (cursor) |
|
s->cx = wp->saved_cx; |
if (s->cx > screen_size_x(s) - 1) |
if (s->cx > screen_size_x(s) - 1) |
s->cx = screen_size_x(s) - 1; |
s->cx = screen_size_x(s) - 1; |
s->cy = wp->saved_cy; |
if (cursor) |
|
s->cy = wp->saved_cy; |
if (s->cy > screen_size_y(s) - 1) |
if (s->cy > screen_size_y(s) - 1) |
s->cy = screen_size_y(s) - 1; |
s->cy = screen_size_y(s) - 1; |
memcpy(gc, &wp->saved_cell, sizeof *gc); |
memcpy(gc, &wp->saved_cell, sizeof *gc); |