commit 1e787e49f28da361e41988e4418d5ae649fc1514
parent 968273b1c3e42fc0a9f184aa56fb54a9100d1d42
Author: William Casarin <jb55@jb55.com>
Date: Tue, 6 Aug 2019 13:53:17 -0700
query_span: don't query hidden calendars
Diffstat:
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/viscal.c b/viscal.c
@@ -941,6 +941,9 @@ static int query_span(struct cal *cal, int index_hint, time_t start, time_t end,
for (int i=index_hint; i < cal->nevents; i++) {
ev = &cal->events[i];
+ if (!ev->ical->visible)
+ continue;
+
icaltimetype dtstart =
icalcomponent_get_dtstart(ev->vevent);
@@ -986,12 +989,7 @@ static void move_relative(struct cal *cal, int rel)
struct event *ev = &cal->events[hit];
vevent_span_timet(ev->vevent, &st, &et);
- if (!ev->ical->visible) {
- hit = -1;
- }
- else {
- cal->current = st;
- }
+ cal->current = st;
}
cal->selected_event_ind = hit;