Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
zunda-arrow committed Dec 26, 2023
1 parent d1c2344 commit e3eb69e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func parseAsciiFile(filename string) (*AsciiArt, error) {
origin := Center

asciiLines := []string{}
var asciiStartLine int
asciiStartLine := -1

for i, line := range contentsLines {
if strings.HasPrefix(line, "messages:") {
Expand All @@ -131,11 +131,15 @@ func parseAsciiFile(filename string) (*AsciiArt, error) {
if strings.HasPrefix(line, "origin") {
origin = Center
}
if strings.HasPrefix(line, "-") {
if strings.HasPrefix(line, "-") && asciiStartLine == -1 {
asciiStartLine = i
}
}

if asciiStartLine == -1 {
asciiStartLine = 0
}

for i := asciiStartLine + 1; i < len(contentsLines); i++ {
if len(strings.TrimSpace(contentsLines[i])) == 0 {
continue
Expand Down
2 changes: 1 addition & 1 deletion tui/draw.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ func (self *Tui) setupDraw() {
draw(self.asciiArt, self.TermSize)
ansi.MoveCursor(0, 0)
self.drawTopLeftBox()
self.drawBox(0, self.TermSize.Cols - 14, 14, []string{"F11 Shutdown", "F12 Reboot"})
self.drawBox(0, self.TermSize.Cols - 13, 14, []string{"F11 Shutdown", "F12 Reboot"})
}

func (self *Tui) draw() error {
Expand Down

0 comments on commit e3eb69e

Please sign in to comment.