From 7e3a8fdcd6cda31fae4d727452d7431b5d19937c Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 26 Apr 2019 06:11:55 -0700 Subject: [PATCH] Fix a number of minor bugs in the Twitter module --- modules/twitter/widget.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/modules/twitter/widget.go b/modules/twitter/widget.go index 4c6adcfd..cd614745 100644 --- a/modules/twitter/widget.go +++ b/modules/twitter/widget.go @@ -12,11 +12,12 @@ import ( ) const HelpText = ` - Keyboard commands for Textfile: + Keyboard commands for Twitter: /: Show/hide this help window h: Previous Twitter name l: Next Twitter name + o: Open the Twitter handle in a browser arrow left: Previous Twitter name arrow right: Next Twitter name @@ -156,7 +157,7 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { widget.Next() return nil case "o": - wtf.OpenFile(widget.CurrentSource()) + wtf.OpenFile(widget.currentSourceURI()) return nil } @@ -171,3 +172,8 @@ func (widget *Widget) keyboardIntercept(event *tcell.EventKey) *tcell.EventKey { return event } } + +func (widget *Widget) currentSourceURI() string { + src := "https://twitter.com/" + widget.CurrentSource() + return src +}