From: Max Kellermann Date: Sat, 10 Oct 2009 17:37:58 +0000 (+0200) Subject: list_window: simplify show_cursor formula X-Git-Tag: release-0.16~122 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aa936d26e4dba606f80c3189d7a8817a1fcc0252;p=ncmpc.git list_window: simplify show_cursor formula And call list_window_get_range() only if show_cursor is true. --- 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;