Skip to content

Commit 4a4a7bf

Browse files
shaneHowearthLallassu
authored andcommitted
Select the first article in the feed when switching to a new feed
1 parent 7cb1222 commit 4a4a7bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/window.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,19 +446,24 @@ func (w *Window) ArticlesHasFocus() bool {
446446
// MoveDown handles a keypress for moving down in feeds/articles
447447
func (w *Window) MoveDown() {
448448
p := w.app.GetFocus()
449+
// Article window
449450
if p == w.articles {
450451
count := w.articles.GetRowCount()
451452
r, _ := w.articles.GetSelection()
452453
if r < count-1 {
453454
w.articles.Select(r+1, 3)
454455
}
455456
} else if p == w.feeds {
457+
// Feed window
456458
count := w.feeds.GetRowCount()
457459
r, _ := w.feeds.GetSelection()
458460
if r < count-1 {
459461
w.feeds.Select(r+1, 0)
460462
}
463+
// Set selected article to first article in feed
464+
w.articles.Select(0, 3)
461465
} else if p == w.preview {
466+
// Preview window
462467
r, _ := w.preview.GetScrollOffset()
463468
w.preview.ScrollTo(r+1, 0)
464469
}

0 commit comments

Comments
 (0)