Skip to content

Commit

Permalink
fix(help): add guard for too width divider
Browse files Browse the repository at this point in the history
  • Loading branch information
Maciej Więcek committed Nov 23, 2023
1 parent aec866c commit 45bf002
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions ui/widgets/help/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ func (m Model) View(keyMap help.KeyMap) string {

physicalWidth, _, _ := term.GetSize(int(os.Stdout.Fd()))
dividerWidth := physicalWidth - lipgloss.Width(helpView) - lipgloss.Width(status)

if dividerWidth < 0 {
dividerWidth = 0
}
divider := strings.Repeat(" ", dividerWidth)

return lipgloss.JoinHorizontal(
Expand Down

0 comments on commit 45bf002

Please sign in to comment.