diff options
author | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-01 13:36:06 +0200 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtzfr.eu> | 2020-08-01 13:36:06 +0200 |
commit | c74ac4a79d3a0fd65ac6002dc9869477ed0ddba6 (patch) | |
tree | 108951c16218625db2e7af245b23af7921a7d331 /ui/ui.go | |
parent | Make message handlers able to return more than one event (diff) |
Randomize welcome messages
Diffstat (limited to 'ui/ui.go')
-rw-r--r-- | ui/ui.go | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -3,6 +3,7 @@ package ui import ( "github.com/gdamore/tcell" "github.com/mattn/go-runewidth" + "math/rand" "sync/atomic" "time" ) @@ -46,12 +47,13 @@ func New() (ui *UI, err error) { ui.exit.Store(false) + hmIdx := rand.Intn(len(homeMessages)) ui.bufferList = BufferList{ List: []Buffer{ { Title: "home", Highlights: 0, - Content: []Line{NewLineNow(homeMessages[0])}, + Content: []Line{NewLineNow(homeMessages[hmIdx])}, }, }, } |