From 0be6a3041ff58e716e6e44ff577dcc62685b3613 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 20 Nov 2007 18:46:32 +0000 Subject: [PATCH] Style: ry_* -> r* --- TODO | 8 ++++-- input.c | 12 ++++---- screen.c | 86 ++++++++++++++++++++++++++++---------------------------- tmux.h | 6 ++-- 4 files changed, 58 insertions(+), 54 deletions(-) diff --git a/TODO b/TODO index 50d4e3e8..7ecb806c 100644 --- a/TODO +++ b/TODO @@ -5,9 +5,7 @@ - alt charset, borders etc (terminfo(5)/Line Graphics) - new window command prompt - mouse handling and some other bits elinks needs -- scrollback - server doesn't handle SIGTERM anymore... -- copy/paste - the whole input/screen/local thing sucks a bit, reorganise/redesign it - line mode/char-at-a-time mode a la telnet? - some of the uses of buffers really sucks. buffer_reverse_add/remove, @@ -67,7 +65,13 @@ - session specification is all over the place. some things use -s before cmd, some -s after, some no -s, there are various uses of -n. the differences are sort of logical, but confusing. needs rethought +- bind non prefix keys (useful for shift-pageup for scrollback, when we + have scrollback) +- stuff like rename would be nice to be able to do in-client like screen, if + it could be implemented in a non-icky way -- For 0.2 -------------------------------------------------------------------- - copy and paste +- scrollback + phys screen vs virt screen? or seperate scrollback buffer? - window splitting? diff --git a/input.c b/input.c index d422ae54..f215b861 100644 --- a/input.c +++ b/input.c @@ -1,4 +1,4 @@ -/* $Id: input.c,v 1.31 2007-11-16 16:28:14 nicm Exp $ */ +/* $Id: input.c,v 1.32 2007-11-20 18:46:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -470,7 +470,7 @@ input_handle_private_two(u_char ch, struct input_ctx *ictx) input_store_two( ictx->b, CODE_ATTRIBUTES, s->attr, s->colr); input_store_two(ictx->b, CODE_SCROLLREGION, - s->ry_upper + 1, s->ry_lower + 1); + s->rupper + 1, s->rlower + 1); input_store_two( ictx->b, CODE_CURSORMOVE, s->cy + 1, s->cx + 1); break; @@ -673,7 +673,7 @@ input_handle_sequence_dl(struct input_ctx *ictx) return; } - if (s->cy < s->ry_upper || s->cy > s->ry_lower) + if (s->cy < s->rupper || s->cy > s->rlower) screen_delete_lines(s, s->cy, n); else screen_delete_lines_region(s, s->cy, n); @@ -721,7 +721,7 @@ input_handle_sequence_il(struct input_ctx *ictx) log_debug3("il: out of range: %hu", n); return; } - if (s->cy < s->ry_upper || s->cy > s->ry_lower) + if (s->cy < s->rupper || s->cy > s->rlower) screen_insert_lines(s, s->cy, n); else screen_insert_lines_region(s, s->cy, n); @@ -1029,8 +1029,8 @@ input_handle_sequence_decstbm(struct input_ctx *ictx) s->cx = 0; s->cy = n - 1; - s->ry_upper = n - 1; - s->ry_lower = m - 1; + s->rupper = n - 1; + s->rlower = m - 1; input_store_two(ictx->b, CODE_SCROLLREGION, n, m); } diff --git a/screen.c b/screen.c index e9c66aa0..d4bee630 100644 --- a/screen.c +++ b/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.23 2007-10-12 13:51:44 nicm Exp $ */ +/* $Id: screen.c,v 1.24 2007-11-20 18:46:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -104,8 +104,8 @@ screen_create(struct screen *s, u_int sx, u_int sy) s->cx = 0; s->cy = 0; - s->ry_upper = 0; - s->ry_lower = screen_last_y(s); + s->rupper = 0; + s->rlower = screen_last_y(s); s->attr = SCREEN_DEFATTR; s->colr = SCREEN_DEFCOLR; @@ -142,8 +142,8 @@ screen_resize(struct screen *s, u_int sx, u_int sy) s->sx = sx; s->sy = sy; - s->ry_upper = 0; - s->ry_lower = screen_last_y(s); + s->rupper = 0; + s->rlower = screen_last_y(s); if (sy < oy) { ny = oy - sy; @@ -237,7 +237,7 @@ screen_draw(struct screen *s, struct buffer *b, u_int uy, u_int ly) attr = 0; colr = SCREEN_DEFCOLR; - input_store_two(b, CODE_SCROLLREGION, s->ry_upper + 1, s->ry_lower + 1); + input_store_two(b, CODE_SCROLLREGION, s->rupper + 1, s->rlower + 1); input_store_zero(b, CODE_CURSOROFF); input_store_two(b, CODE_ATTRIBUTES, attr, colr); @@ -349,7 +349,7 @@ screen_write_character(struct screen *s, u_char ch) void screen_cursor_up_scroll(struct screen *s) { - if (s->cy == s->ry_upper) + if (s->cy == s->rupper) screen_scroll_region_down(s); else if (s->cy > 0) s->cy--; @@ -359,7 +359,7 @@ screen_cursor_up_scroll(struct screen *s) void screen_cursor_down_scroll(struct screen *s) { - if (s->cy == s->ry_lower) + if (s->cy == s->rlower) screen_scroll_region_up(s); else if (s->cy < screen_last_y(s)) s->cy++; @@ -369,62 +369,62 @@ screen_cursor_down_scroll(struct screen *s) void screen_scroll_region_up(struct screen *s) { - log_debug("scrolling region up: %u:%u", s->ry_upper, s->ry_lower); + log_debug("scrolling region up: %u:%u", s->rupper, s->rlower); /* * Scroll scrolling region up: - * - delete ry_upper - * - move ry_upper + 1 to ry_lower to ry_upper - * - make new line at ry_lower + * - delete rupper + * - move rupper + 1 to rlower to rupper + * - make new line at rlower * * Example: region is 12 to 24. - * ry_lower = 24, ry_upper = 12 + * rlower = 24, rupper = 12 * screen_free_lines(s, 12, 1); * screen_move_lines(s, 12, 13, 12); * screen_make_lines(s, 24, 1); */ - screen_free_lines(s, s->ry_upper, 1); + screen_free_lines(s, s->rupper, 1); - if (s->ry_upper != s->ry_lower) { + if (s->rupper != s->rlower) { screen_move_lines(s, - s->ry_upper, s->ry_upper + 1, s->ry_lower - s->ry_upper); + s->rupper, s->rupper + 1, s->rlower - s->rupper); } - screen_make_lines(s, s->ry_lower, 1); + screen_make_lines(s, s->rlower, 1); screen_fill_lines( - s, s->ry_lower, 1, SCREEN_DEFDATA, SCREEN_DEFATTR, SCREEN_DEFCOLR); + s, s->rlower, 1, SCREEN_DEFDATA, SCREEN_DEFATTR, SCREEN_DEFCOLR); } /* Scroll region down. */ void screen_scroll_region_down(struct screen *s) { - log_debug("scrolling region down: %u:%u", s->ry_upper, s->ry_lower); + log_debug("scrolling region down: %u:%u", s->rupper, s->rlower); /* * Scroll scrolling region down: - * - delete ry_lower - * - move ry_upper to ry_lower - 1 to ry_upper + 1 - * - make new line at ry_upper + * - delete rlower + * - move rupper to rlower - 1 to rupper + 1 + * - make new line at rupper * * Example: region is 12 to 24. - * ry_lower = 24, ry_upper = 12 + * rlower = 24, rupper = 12 * screen_free_lines(s, 24, 1); * screen_move_lines(s, 13, 12, 12); * screen_make_lines(s, 12, 1); */ - screen_free_lines(s, s->ry_lower, 1); + screen_free_lines(s, s->rlower, 1); - if (s->ry_upper != s->ry_lower) { + if (s->rupper != s->rlower) { screen_move_lines(s, - s->ry_upper + 1, s->ry_upper, s->ry_lower - s->ry_upper); + s->rupper + 1, s->rupper, s->rlower - s->rupper); } - screen_make_lines(s, s->ry_upper, 1); + screen_make_lines(s, s->rupper, 1); screen_fill_lines( - s, s->ry_upper, 1, SCREEN_DEFDATA, SCREEN_DEFATTR, SCREEN_DEFCOLR); + s, s->rupper, 1, SCREEN_DEFDATA, SCREEN_DEFATTR, SCREEN_DEFCOLR); } /* Scroll screen up. */ @@ -544,12 +544,12 @@ screen_insert_lines(struct screen *s, u_int py, u_int ny) void screen_insert_lines_region(struct screen *s, u_int py, u_int ny) { - if (py < s->ry_upper || py > s->ry_lower) + if (py < s->rupper || py > s->rlower) return; - if (py + ny > s->ry_lower) - ny = s->ry_lower - py; + if (py + ny > s->rlower) + ny = s->rlower - py; log_debug("inserting lines in region: %u,%u (%u,%u)", py, ny, - s->ry_upper, s->ry_lower); + s->rupper, s->rlower); /* * Insert range of ny lines at py: @@ -564,10 +564,10 @@ screen_insert_lines_region(struct screen *s, u_int py, u_int ny) * screen_make_lines(s, 13, 2); - make lines 13,14 */ - screen_free_lines(s, (s->ry_lower + 1) - ny, ny); + screen_free_lines(s, (s->rlower + 1) - ny, ny); - if (py != s->ry_lower) - screen_move_lines(s, py + ny, py, (s->ry_lower + 1) - py - ny); + if (py != s->rlower) + screen_move_lines(s, py + ny, py, (s->rlower + 1) - py - ny); screen_make_lines(s, py, ny); screen_fill_lines( @@ -612,12 +612,12 @@ screen_delete_lines(struct screen *s, u_int py, u_int ny) void screen_delete_lines_region(struct screen *s, u_int py, u_int ny) { - if (py < s->ry_upper || py > s->ry_lower) + if (py < s->rupper || py > s->rlower) return; - if (py + ny > s->ry_lower) - ny = s->ry_lower - py; + if (py + ny > s->rlower) + ny = s->rlower - py; log_debug("deleting lines in region: %u,%u (%u,%u)", py, ny, - s->ry_upper, s->ry_lower); + s->rupper, s->rlower); /* * Delete range of ny lines at py: @@ -634,11 +634,11 @@ screen_delete_lines_region(struct screen *s, u_int py, u_int ny) screen_free_lines(s, py, ny); - if (py != s->ry_lower) - screen_move_lines(s, py, py + ny, (s->ry_lower + 1) - py - ny); + if (py != s->rlower) + screen_move_lines(s, py, py + ny, (s->rlower + 1) - py - ny); - screen_make_lines(s, (s->ry_lower + 1) - ny, ny); - screen_fill_lines(s, (s->ry_lower + 1) - ny, + screen_make_lines(s, (s->rlower + 1) - ny, ny); + screen_fill_lines(s, (s->rlower + 1) - ny, ny, SCREEN_DEFDATA, SCREEN_DEFATTR, SCREEN_DEFCOLR); } diff --git a/tmux.h b/tmux.h index ebbc37cd..d270a2e5 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.82 2007-11-20 18:11:37 nicm Exp $ */ +/* $Id: tmux.h,v 1.83 2007-11-20 18:46:32 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -357,8 +357,8 @@ struct screen { u_int sx; /* size x */ u_int sy; /* size y */ - u_int ry_upper; /* scroll region top */ - u_int ry_lower; /* scroll region bottom */ + u_int rupper; /* scroll region top */ + u_int rlower; /* scroll region bottom */ u_int cx; /* cursor x */ u_int cy; /* cursor y */