Skip to content

Commit

Permalink
Fix #6410
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Jul 2, 2023
1 parent 22c2687 commit 0bc4f80
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kittens/themes/ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ func (self *handler) draw_tab_bar() {
func center_string(x string, width int) string {
l := wcswidth.Stringwidth(x)
spaces := int(float64(width-l) / 2)
return strings.Repeat(" ", spaces) + x + strings.Repeat(" ", width-(spaces+l))
return strings.Repeat(" ", utils.Max(0, spaces)) + x + strings.Repeat(" ", utils.Max(0, width-(spaces+l)))
}

func (self *handler) draw_theme_demo() {
Expand Down

0 comments on commit 0bc4f80

Please sign in to comment.