summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-11-21 21:28:58 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-11-21 21:28:58 +0000
commit1e5cb8d2e4511be550a409baa9060bbd16f2de0e (patch)
tree2fa7a5fe4e7c4ea6ebf9d6f1b0675e028ddb2020
parentf8686f126d28b08aabc1e56aa98ca9ee80e0c846 (diff)
Free entire screen when destroyed.
-rw-r--r--TODO1
-rw-r--r--screen-display.c7
-rw-r--r--screen.c4
-rw-r--r--window-scroll.c4
4 files changed, 9 insertions, 7 deletions
diff --git a/TODO b/TODO
index 47d17a62..5b5b12dc 100644
--- a/TODO
+++ b/TODO
@@ -56,6 +56,7 @@
kill server
command to run something without a window at all?
command to insert a key into a window (send-key)
+ command to purge window history
extend list-clients to list clients attached to a session (-a for all?)
bring back detach-session to detach all clients on a session?
- function groups, bind-key ^W { select-window 0; send-key ^W } etc
diff --git a/screen-display.c b/screen-display.c
index 786d704a..8aceb88c 100644
--- a/screen-display.c
+++ b/screen-display.c
@@ -1,4 +1,4 @@
-/* $Id: screen-display.c,v 1.3 2007-11-21 15:35:53 nicm Exp $ */
+/* $Id: screen-display.c,v 1.4 2007-11-21 21:28:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -180,9 +180,10 @@ screen_display_scroll_region_up(struct screen *s)
if (s->hsize == s->hlimit) {
/*
- * If the limit is hit, shift the whole thing up.
- * XXX this is inefficient, is there a better way?
+ * If the limit is hit, free the first and shift
+ * the whole thing up.
*/
+ screen_free_lines(s, 0, 1);
screen_move_lines(s, 0, 1, sy - 1);
} else {
s->hsize++;
diff --git a/screen.c b/screen.c
index cf5d8167..ab130b4c 100644
--- a/screen.c
+++ b/screen.c
@@ -1,4 +1,4 @@
-/* $Id: screen.c,v 1.33 2007-11-21 19:53:56 nicm Exp $ */
+/* $Id: screen.c,v 1.34 2007-11-21 21:28:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -205,7 +205,7 @@ screen_resize(struct screen *s, u_int sx, u_int sy)
void
screen_destroy(struct screen *s)
{
- screen_free_lines(s, 0, s->dy);
+ screen_free_lines(s, 0, s->dy + s->hsize);
xfree(s->grid_data);
xfree(s->grid_attr);
xfree(s->grid_colr);
diff --git a/window-scroll.c b/window-scroll.c
index 2d37f0d0..0efd3fe0 100644
--- a/window-scroll.c
+++ b/window-scroll.c
@@ -1,4 +1,4 @@
-/* $Id: window-scroll.c,v 1.9 2007-11-21 19:53:57 nicm Exp $ */
+/* $Id: window-scroll.c,v 1.10 2007-11-21 21:28:58 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -95,7 +95,7 @@ window_scroll_draw(struct window *w, struct buffer *b, u_int py, u_int ny)
struct screen_draw_ctx ctx;
if (s->hsize != data->size) {
- data->ox += s->hsize - data->size;
+ data->oy += s->hsize - data->size;
data->size = s->hsize;
}