commit 3d0d831e369001048c4877a7cdacb1d6b188665b
parent 39923ea9eeda6253e0fea8ada0f0b31937dbf0f6
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Sat, 27 Jun 2020 21:46:57 +0200
fix regression in selection of feed when `togglenew` is set for the sidebar
Using the global feeds does not match the same indices.
Diffstat:
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/sfeed_curses.c b/sfeed_curses.c
@@ -1183,8 +1183,10 @@ mousereport(int button, int release, int x, int y)
break;
if (i == PaneFeeds) {
pane_setpos(p, pos);
- feeds_set(&feeds[pos]);
- feed_load(curfeed, curfeed->fp);
+ row = pane_row_get(p, pos);
+ f = (struct feed *)row->data;
+ feeds_set(f);
+ feed_load(f, f->fp);
} else if (i == PaneItems) {
/* clicking the same highlighted row */
if (p->pos == pos && !changedpane) {
@@ -1552,7 +1554,8 @@ nextpage:
case 't': /* toggle showing only new in sidebar */
onlynew = !onlynew;
pane_setpos(&panes[PaneFeeds], 0);
- feeds_set(&feeds[0]);
+ row = pane_row_get(&panes[PaneFeeds], 0);
+ feeds_set((struct feed *)row->data);
updatesidebar(onlynew);
updategeom();
break;
@@ -1560,8 +1563,10 @@ nextpage:
case '\n':
if (selpane == PaneFeeds && panes[PaneFeeds].nrows) {
p = &panes[selpane];
- feeds_set(&feeds[p->pos]);
- feed_load(curfeed, curfeed->fp);
+ row = pane_row_get(p, p->pos);
+ f = (struct feed *)row->data;
+ feeds_set(f);
+ feed_load(f, f->fp);
} else if (selpane == PaneItems && panes[PaneItems].nrows) {
p = &panes[PaneItems];
row = pane_row_get(p, p->pos);