From aa936d26e4dba606f80c3189d7a8817a1fcc0252 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sat, 10 Oct 2009 19:37:58 +0200 Subject: [PATCH] list_window: simplify show_cursor formula And call list_window_get_range() only if show_cursor is true. --- src/list_window.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/list_window.c b/src/list_window.c index 9e67f9f..124b482 100644 --- a/src/list_window.c +++ b/src/list_window.c @@ -380,13 +380,12 @@ list_window_paint(const struct list_window *lw, list_window_callback_fn_t callback, void *callback_data) { - bool show_cursor = !lw->hide_cursor; - struct list_window_range range; - - show_cursor = show_cursor && + bool show_cursor = !lw->hide_cursor && (!options.hardware_cursor || lw->range_selection); + struct list_window_range range; - list_window_get_range(lw, &range); + if (show_cursor) + list_window_get_range(lw, &range); for (unsigned i = 0; i < lw->rows; i++) { const char *label; -- 2.30.2