From a38e0081475fbf243d6455c2ea6ffa6ef9efc3c1 Mon Sep 17 00:00:00 2001 From: Stefan Mesken Date: Sun, 12 May 2024 13:15:49 +0200 Subject: [PATCH] show title in `Random Prose` --- v1/selection.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/v1/selection.go b/v1/selection.go index 5d92a15..ea3d347 100644 --- a/v1/selection.go +++ b/v1/selection.go @@ -91,13 +91,13 @@ func createSelection(cursorPos int) Selection { lessons = append(lessons, lesson) content.Rows = append(content.Rows, lesson.Title) - lesson = Lesson{ - Title: "Random Prose", - Content: "", - Tag: PROSE_MODE, - } - lessons = append(lessons, lesson) - content.Rows = append(content.Rows, lesson.Title) + lesson = Lesson{ + Title: "Random Prose", + Content: "", + Tag: PROSE_MODE, + } + lessons = append(lessons, lesson) + content.Rows = append(content.Rows, lesson.Title) // Load lessons from directory files, err := ioutil.ReadDir(home + LessonsDir) @@ -118,7 +118,8 @@ func createSelection(cursorPos int) Selection { content.Rows = append(content.Rows, lesson.Title) } - lessons[1].Content = lessons[rand.Intn(len(lessons) - 2) + 2].Content + lessons[1].Title = "Random Prose - " + lessons[rand.Intn(len(lessons)-2)+2].Title + lessons[1].Content = lessons[rand.Intn(len(lessons)-2)+2].Content content.SetRect(MainMinX, MainMinY, MainMaxX, MainMaxY) content.SelectedRowStyle = ui.NewStyle(ui.ColorGreen)