diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-24 13:26:42 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2007-11-24 13:26:42 +0000 |
commit | 43a05b1884c86201f8a2c9da58d65b4341a81f92 (patch) | |
tree | d7f0227b26bb1c5268ebec398387b38c3076b354 /screen-display.c | |
parent | 4e21786eef987d90ca199d7bde3fc6109c9e2249 (diff) |
Better fix, handle delete-last-line properly.
Diffstat (limited to 'screen-display.c')
-rw-r--r-- | screen-display.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/screen-display.c b/screen-display.c index ff350a56..9d4dee0c 100644 --- a/screen-display.c +++ b/screen-display.c @@ -1,4 +1,4 @@ -/* $Id: screen-display.c,v 1.6 2007-11-24 12:33:56 nicm Exp $ */ +/* $Id: screen-display.c,v 1.7 2007-11-24 13:26:42 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -259,7 +259,7 @@ screen_display_insert_lines(struct screen *s, u_int py, u_int ny) fatalx("bad value"); if (py + ny > screen_last_y(s)) - ny = screen_last_y(s) - py; + ny = screen_size_y(s) - py; if (ny == 0) return; @@ -278,7 +278,7 @@ screen_display_insert_lines(struct screen *s, u_int py, u_int ny) screen_display_free_lines(s, screen_size_y(s) - ny, ny); - if (py != screen_last_y(s)) { + if (py + ny != screen_size_y(s)) { screen_display_move_lines( s, py + ny, py, screen_size_y(s) - py - ny); } @@ -296,7 +296,7 @@ screen_display_insert_lines_region(struct screen *s, u_int py, u_int ny) fatalx("bad value"); if (py + ny > s->rlower) - ny = s->rlower - py; + ny = (s->rlower + 1) - py; if (ny == 0) return; @@ -315,7 +315,7 @@ screen_display_insert_lines_region(struct screen *s, u_int py, u_int ny) screen_display_free_lines(s, (s->rlower + 1) - ny, ny); - if (py != s->rlower) { + if (py + ny != s->rlower + 1) { screen_display_move_lines( s, py + ny, py, (s->rlower + 1) - py - ny); } @@ -333,7 +333,7 @@ screen_display_delete_lines(struct screen *s, u_int py, u_int ny) fatalx("bad value"); if (py + ny > screen_last_y(s)) - ny = screen_last_y(s) - py; + ny = screen_size_y(s) - py; if (ny == 0) return; @@ -352,7 +352,7 @@ screen_display_delete_lines(struct screen *s, u_int py, u_int ny) screen_display_free_lines(s, py, ny); - if (py != screen_last_y(s)) { + if (py + ny != screen_size_y(s)) { screen_display_move_lines( s, py, py + ny, screen_size_y(s) - py - ny); } @@ -370,7 +370,7 @@ screen_display_delete_lines_region(struct screen *s, u_int py, u_int ny) fatalx("bad value"); if (py + ny > s->rlower) - ny = s->rlower - py; + ny = (s->rlower + 1) - py; if (ny == 0) return; @@ -389,7 +389,7 @@ screen_display_delete_lines_region(struct screen *s, u_int py, u_int ny) screen_display_free_lines(s, py, ny); - if (py != s->rlower) { + if (py + ny != s->rlower + 1) { screen_display_move_lines( s, py, py + ny, (s->rlower + 1) - py - ny); } |