sfeed_curses

[fork] sfeed (atom feed) reader
Log | Files | Refs | README | LICENSE

commit e7ee9b1e638e912fde599f235a61f618de22ae44
parent a8a304c681e4c62870c295c4579dc3495730a161
Author: hhvn <hayden@haydenvh.com>
Date:   Mon,  8 Feb 2021 13:16:33 +0000

sfeed_curses.c: use (capital) J, K, L keys to navigate sidebar without leaving main pane

Diffstat:
Msfeed_curses.c | 32++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+), 0 deletions(-)

diff --git a/sfeed_curses.c b/sfeed_curses.c @@ -1857,10 +1857,20 @@ keyup: case 'k': pane_scrolln(&panes[selpane], -1); break; + case 'K': + cyclepanen(-1); + pane_scrolln(&panes[selpane], -1); + cyclepanen(+1); + break; keydown: case 'j': pane_scrolln(&panes[selpane], +1); break; + case 'J': + cyclepanen(-1); + pane_scrolln(&panes[selpane], +1); + cyclepanen(+1); + break; keyleft: case 'h': cyclepanen(-1); @@ -1872,6 +1882,28 @@ keyright: case '\t': cyclepane(); break; + case 'L': + cyclepanen(-1); + p = &panes[selpane]; + if (selpane == PaneFeeds && panes[selpane].nrows) { + row = pane_row_get(p, p->pos); + f = (struct feed *)row->data; + feeds_set(f); + urls_read(); + if (f->fp) + feed_load(f, f->fp); + urls_free(); + /* redraw row: counts could be changed */ + updatesidebar(onlynew); + updatetitle(); + } else if (selpane == PaneItems && panes[selpane].nrows) { + row = pane_row_get(p, p->pos); + item = (struct item *)row->data; + markread(p, p->pos, p->pos, 1); + forkexec((char *[]) { plumbercmd, item->fields[FieldLink], NULL }); + } + cyclepanen(+1); + break; startpos: case 'g': pane_setpos(&panes[selpane], 0);