From 80e30f693c925841b5874063ca1d8aab2c42d231 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 27 Nov 2007 19:32:15 +0000 Subject: [PATCH] Minor tweaks/missed bits. --- screen.c | 10 +++++++++- tmux.h | 3 ++- tty.c | 3 ++- window-copy.c | 3 ++- window-scroll.c | 4 +++- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/screen.c b/screen.c index 4f6824e8..4318cdf5 100644 --- a/screen.c +++ b/screen.c @@ -1,4 +1,4 @@ -/* $Id: screen.c,v 1.50 2007-11-27 19:23:34 nicm Exp $ */ +/* $Id: screen.c,v 1.51 2007-11-27 19:32:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -323,6 +323,14 @@ screen_draw_start(struct screen_draw_ctx *ctx, struct screen *s, ctx->write(ctx->data, TTY_CURSOROFF); } +/* Set offset. */ +void +screen_draw_set_offset(struct screen_draw_ctx *ctx, u_int ox, u_int oy) +{ + ctx->ox = ox; + ctx->oy = oy; +} + /* Set selection. */ void screen_draw_set_selection(struct screen_draw_ctx *ctx, diff --git a/tmux.h b/tmux.h index 4cc44694..84ba6fb2 100644 --- a/tmux.h +++ b/tmux.h @@ -1,4 +1,4 @@ -/* $Id: tmux.h,v 1.101 2007-11-27 19:23:34 nicm Exp $ */ +/* $Id: tmux.h,v 1.102 2007-11-27 19:32:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -833,6 +833,7 @@ void screen_draw_start_session( void screen_draw_start(struct screen_draw_ctx *, struct screen *s, void (*)(void *, int, ...), void *, u_int, u_int); void screen_draw_stop(struct screen_draw_ctx *); +void screen_draw_set_offset(struct screen_draw_ctx *, u_int, u_int); void screen_draw_set_selection( struct screen_draw_ctx *, int, u_int, u_int, u_int, u_int); int screen_draw_check_selection(struct screen_draw_ctx *, u_int, u_int); diff --git a/tty.c b/tty.c index 636c738c..5e07b129 100644 --- a/tty.c +++ b/tty.c @@ -1,4 +1,4 @@ -/* $Id: tty.c,v 1.1 2007-11-27 19:23:34 nicm Exp $ */ +/* $Id: tty.c,v 1.2 2007-11-27 19:32:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -74,6 +74,7 @@ tty_open(struct tty *tty, char **cause) break; default: xasprintf(cause, "unknown error"); + break; } return (-1); } diff --git a/window-copy.c b/window-copy.c index 1840914c..eb5c5d37 100644 --- a/window-copy.c +++ b/window-copy.c @@ -1,4 +1,4 @@ -/* $Id: window-copy.c,v 1.10 2007-11-27 19:23:34 nicm Exp $ */ +/* $Id: window-copy.c,v 1.11 2007-11-27 19:32:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -120,6 +120,7 @@ window_copy_draw( data->oy += s->hsize - data->size; data->size = s->hsize; } + screen_draw_set_offset(ctx, data->ox, data->oy); if (py != 0) screen_draw_lines(ctx, py, ny); diff --git a/window-scroll.c b/window-scroll.c index 07d0663b..d696dabe 100644 --- a/window-scroll.c +++ b/window-scroll.c @@ -1,4 +1,4 @@ -/* $Id: window-scroll.c,v 1.13 2007-11-27 19:23:34 nicm Exp $ */ +/* $Id: window-scroll.c,v 1.14 2007-11-27 19:32:15 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -86,6 +86,7 @@ window_scroll_draw_position(struct window *w, struct screen_draw_ctx *ctx) screen_draw_move_cursor(ctx, screen_size_x(ctx->s) - len, 0); screen_draw_set_attributes(ctx, 0, status_colour); + screen_draw_write_string(ctx, "%s", ptr); } void @@ -99,6 +100,7 @@ window_scroll_draw( data->oy += s->hsize - data->size; data->size = s->hsize; } + screen_draw_set_offset(ctx, data->ox, data->oy); if (py != 0) screen_draw_lines(ctx, py, ny);