From 9a37eb4d94ab26b2d70ead0f75ff90817c274418 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 6 Dec 2007 21:42:00 +0000 Subject: [PATCH] Bug fix; don't bail except on first line when printing. --- key-bindings.c | 5 ++--- window-more.c | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/key-bindings.c b/key-bindings.c index e217d798..8acf71f1 100644 --- a/key-bindings.c +++ b/key-bindings.c @@ -1,4 +1,4 @@ -/* $Id: key-bindings.c,v 1.24 2007-12-06 10:04:42 nicm Exp $ */ +/* $Id: key-bindings.c,v 1.25 2007-12-06 21:42:00 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -165,8 +165,7 @@ key_bindings_print(struct cmd_ctx *ctx, const char *fmt, ...) struct window *w = ctx->session->curw->window; va_list ap; - if (window_set_mode(w, &window_more_mode) != 0) - return; + window_set_mode(w, &window_more_mode); va_start(ap, fmt); window_more_vadd(w, fmt, ap); diff --git a/window-more.c b/window-more.c index fc201500..1c5c6f2a 100644 --- a/window-more.c +++ b/window-more.c @@ -1,4 +1,4 @@ -/* $Id: window-more.c,v 1.7 2007-12-06 10:04:43 nicm Exp $ */ +/* $Id: window-more.c,v 1.8 2007-12-06 21:42:00 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -60,10 +60,7 @@ window_more_vadd(struct window *w, const char *fmt, va_list ap) xvasprintf(&msg, fmt, ap); ARRAY_ADD(&data->list, msg); - size = ARRAY_LENGTH(&data->list); - if (size == 0) - return; - size--; + size = ARRAY_LENGTH(&data->list) - 1; if (size >= data->top && size <= data->top + screen_last_y(s)) { screen_write_start_window(&ctx, w); window_more_write_line(w, &ctx, size - data->top);