summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b398de1)
raw | patch | inline | side by side (parent: b398de1)
author | Max Kellermann <max@duempel.org> | |
Fri, 9 Oct 2009 18:48:19 +0000 (20:48 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 9 Oct 2009 18:48:19 +0000 (20:48 +0200) |
Combine all the checks in the two boolean variables "show_cursor" and
"selected".
"selected".
src/list_window.c | patch | blob | history |
diff --git a/src/list_window.c b/src/list_window.c
index 92eaba5d0c6f05f72f63fb8a2e7fd12529cada2b..86da180ac56f493a02495719df5c09cb26cd1db2 100644 (file)
--- a/src/list_window.c
+++ b/src/list_window.c
}
}
+ show_cursor = show_cursor &&
+ (!options.hardware_cursor || lw->range_selection);
+
for (i = 0; i < lw->rows; i++) {
const char *label;
char *second_column = NULL;
wmove(lw->w, i, 0);
if (label) {
- bool selected = (lw->start + i >= lw->selected_start && lw->start + i <= lw->selected_end);
+ bool selected = show_cursor &&
+ lw->start + i >= lw->selected_start &&
+ lw->start + i <= lw->selected_end;
unsigned len = utf8_width(label);
if (highlight)
else
colors_use(lw->w, COLOR_LIST);
- if (show_cursor && selected &&
- (!options.hardware_cursor || lw->range_selection))
+ if (selected)
wattron(lw->w, A_REVERSE);
//waddnstr(lw->w, label, lw->cols);