mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-14 07:49:01 +02:00
set/reset mode window functions.
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/* $Id: window-scroll.c,v 1.15 2007-12-06 09:46:23 nicm Exp $ */
|
||||
/* $Id: window-scroll.c,v 1.16 2007-12-06 10:04:43 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
#include "tmux.h"
|
||||
|
||||
void window_scroll_init(struct window *);
|
||||
struct screen *window_scroll_init(struct window *);
|
||||
void window_scroll_free(struct window *);
|
||||
void window_scroll_resize(struct window *, u_int, u_int);
|
||||
void window_scroll_key(struct window *, int);
|
||||
@ -52,7 +52,7 @@ struct window_scroll_mode_data {
|
||||
u_int oy;
|
||||
};
|
||||
|
||||
void
|
||||
struct screen *
|
||||
window_scroll_init(struct window *w)
|
||||
{
|
||||
struct window_scroll_mode_data *data;
|
||||
@ -67,12 +67,13 @@ window_scroll_init(struct window *w)
|
||||
s = &data->screen;
|
||||
screen_create(s, screen_size_x(&w->base), screen_size_y(&w->base));
|
||||
s->mode = 0;
|
||||
w->screen = s;
|
||||
|
||||
screen_write_start(&ctx, s, NULL, NULL);
|
||||
for (i = 0; i < screen_size_y(s); i++)
|
||||
window_scroll_write_line(w, &ctx, i);
|
||||
screen_write_stop(&ctx);
|
||||
|
||||
return (s);
|
||||
}
|
||||
|
||||
void
|
||||
@ -80,11 +81,8 @@ window_scroll_free(struct window *w)
|
||||
{
|
||||
struct window_scroll_mode_data *data = w->modedata;
|
||||
|
||||
w->screen = &w->base;
|
||||
screen_destroy(&data->screen);
|
||||
|
||||
w->mode = NULL;
|
||||
xfree(w->modedata);
|
||||
xfree(data);
|
||||
}
|
||||
|
||||
void
|
||||
@ -107,8 +105,7 @@ window_scroll_key(struct window *w, int key)
|
||||
switch (key) {
|
||||
case 'Q':
|
||||
case 'q':
|
||||
window_scroll_free(w);
|
||||
server_redraw_window(w);
|
||||
window_reset_mode(w);
|
||||
break;
|
||||
case 'h':
|
||||
case KEYC_LEFT:
|
||||
|
Reference in New Issue
Block a user