diff --git a/config.go b/config.go index 0d2f011..6548db4 100644 --- a/config.go +++ b/config.go @@ -16,6 +16,7 @@ type Config struct { type GeneralConfig struct { DateTodayFormat string DateFormat string + StartTimeline TimelineType } type StyleConfig struct { @@ -42,6 +43,7 @@ type MediaConfig struct { ImageViewer string ImageSingle bool VideoViewer string + VideoSingle bool } func CreateConfigDir() error { diff --git a/linkoverlay.go b/linkoverlay.go index b059e98..16e9b72 100644 --- a/linkoverlay.go +++ b/linkoverlay.go @@ -78,6 +78,8 @@ func (l *LinkOverlay) InputHandler(event *tcell.EventKey) { } } else { switch event.Key() { + case tcell.KeyEnter: + l.Open() case tcell.KeyUp: l.Prev() case tcell.KeyDown: diff --git a/main.go b/main.go index c7266a6..83c6f73 100644 --- a/main.go +++ b/main.go @@ -197,11 +197,19 @@ func main() { app.UI.MediaOverlay.InputField.HandleChanges, ) - words := strings.Split(":q,:quit,:timeline,:tl", ",") app.UI.CmdBar.Input.SetAutocompleteFunc(func(currentText string) (entries []string) { + words := strings.Split(":q,:quit,:timeline,:tl", ",") if currentText == "" { return } + + if currentText == ":tl " { + words = strings.Split(":tl home,:tl notifications,:tl local,:tl federated,:tl direct", ",") + } + if currentText == ":timeline " { + words = strings.Split(":timeline home,:timeline notifications,:timeline local,:timeline federated,:timeline direct", ",") + } + for _, word := range words { if strings.HasPrefix(strings.ToLower(word), strings.ToLower(currentText)) { entries = append(entries, word) diff --git a/statusview.go b/statusview.go index d6a1ea8..e8a1229 100644 --- a/statusview.go +++ b/statusview.go @@ -97,6 +97,10 @@ func (t *StatusView) ScrollToBeginning() { func (t *StatusView) inputBoth(event *tcell.EventKey) { if event.Key() == tcell.KeyRune { switch event.Rune() { + case 'g': + t.home() + case 'G': + t.end() case 'q', 'Q': if len(t.feeds) > 1 { t.RemoveLatestFeed() @@ -108,6 +112,10 @@ func (t *StatusView) inputBoth(event *tcell.EventKey) { switch event.Key() { case tcell.KeyCtrlC: t.app.UI.Root.Stop() + case tcell.KeyHome: + t.home() + case tcell.KeyEnd: + t.end() } } if len(t.feeds) > 0 { @@ -217,6 +225,18 @@ func (t *StatusView) next() { } } +func (t *StatusView) home() { + t.list.SetCurrentItem(0) + t.feeds[len(t.feeds)-1].DrawToot() + t.loadOlder() +} + +func (t *StatusView) end() { + t.list.SetCurrentItem(-1) + t.feeds[len(t.feeds)-1].DrawToot() + t.loadOlder() +} + func (t *StatusView) loadNewer() { if t.loadingNewer { return @@ -225,10 +245,8 @@ func (t *StatusView) loadNewer() { feedIndex := len(t.feeds) - 1 go func() { new := t.feeds[feedIndex].LoadNewer() - if new == 0 { - return - } - if feedIndex != len(t.feeds)-1 { + if new == 0 || feedIndex != len(t.feeds)-1 { + t.loadingNewer = false return } t.app.UI.Root.QueueUpdateDraw(func() { @@ -252,10 +270,8 @@ func (t *StatusView) loadOlder() { feedIndex := len(t.feeds) - 1 go func() { new := t.feeds[feedIndex].LoadOlder() - if new == 0 { - return - } - if feedIndex != len(t.feeds)-1 { + if new == 0 || feedIndex != len(t.feeds)-1 { + t.loadingOlder = false return } t.app.UI.Root.QueueUpdateDraw(func() {