on main help sign in
fix(ui): fix help wrapping on dialogs
340ce20Andrey Nering
internal/ui/dialog/common.go+3−2
@@ -136,9 +136,10 @@ func (rc *RenderContext) Render() string {
136 if rc.Gap > 0 {
136 if rc.Gap > 0 {
137 parts = append(parts, make([]string, rc.Gap)...)
137 parts = append(parts, make([]string, rc.Gap)...)
138 }
138 }
139+ helpWidth := rc.Width - dialogStyle.GetHorizontalFrameSize()
139 helpStyle := rc.Styles.Dialog.HelpView
140 helpStyle := rc.Styles.Dialog.HelpView
140− helpStyle = helpStyle.Width(rc.Width - dialogStyle.GetHorizontalFrameSize())
141+ helpStyle = helpStyle.Width(helpWidth)
141− helpView := ansi.Truncate(helpStyle.Render(rc.Help), rc.Width, "")
142+ helpView := ansi.Truncate(helpStyle.Render(rc.Help), helpWidth-1, "")
142 parts = append(parts, helpView)
143 parts = append(parts, helpView)
143 }
144 }
144
145