Skip to content

Commit

Permalink
show title in Random Prose
Browse files Browse the repository at this point in the history
  • Loading branch information
KappaDistributive committed May 12, 2024
1 parent 8a88c5f commit a38e008
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions v1/selection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit a38e008

Please sign in to comment.