summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-10-20 21:35:26 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-10-20 21:35:26 +0000
commitc9d225057206c988d04b49087c249a66028f06c5 (patch)
tree342a3f2d3bbe492da35243e83dcee5592f18a653 /usr.bin
parentdd966e2f66bf0f3b530215a52db0f3572dc3ddf1 (diff)
Correctly nuke the EOL $ marker when scrolling, reported by martynas@, thanks.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/window-copy.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/tmux/window-copy.c b/usr.bin/tmux/window-copy.c
index 3f5fbbe7895..73c107b7e5e 100644
--- a/usr.bin/tmux/window-copy.c
+++ b/usr.bin/tmux/window-copy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: window-copy.c,v 1.30 2009/10/13 13:45:56 nicm Exp $ */
+/* $OpenBSD: window-copy.c,v 1.31 2009/10/20 21:35:25 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -1088,7 +1088,7 @@ window_copy_cursor_up(struct window_pane *wp, int scroll_only)
data->cx = data->lastcx;
if (scroll_only || data->cy == 0) {
window_copy_scroll_down(wp, 1);
- if (scroll_only && window_copy_update_selection(wp))
+ if (scroll_only)
window_copy_redraw_lines(wp, data->cy, 2);
} else {
window_copy_update_cursor(wp, data->cx, data->cy - 1);
@@ -1119,7 +1119,7 @@ window_copy_cursor_down(struct window_pane *wp, int scroll_only)
data->cx = data->lastcx;
if (scroll_only || data->cy == screen_size_y(s) - 1) {
window_copy_scroll_up(wp, 1);
- if (scroll_only && window_copy_update_selection(wp))
+ if (scroll_only && data->cy > 0)
window_copy_redraw_lines(wp, data->cy - 1, 2);
} else {
window_copy_update_cursor(wp, data->cx, data->cy + 1);
@@ -1250,7 +1250,10 @@ window_copy_scroll_up(struct window_pane *wp, u_int ny)
screen_write_deleteline(&ctx, ny);
window_copy_write_lines(wp, &ctx, screen_size_y(s) - ny, ny);
window_copy_write_line(wp, &ctx, 0);
- window_copy_write_line(wp, &ctx, 1);
+ if (screen_size_y(s) > 1)
+ window_copy_write_line(wp, &ctx, 1);
+ if (screen_size_y(s) > 3)
+ window_copy_write_line(wp, &ctx, screen_size_y(s) - 2);
if (s->sel.flag && screen_size_y(s) > ny)
window_copy_write_line(wp, &ctx, screen_size_y(s) - ny - 1);
screen_write_cursormove(&ctx, data->cx, data->cy);