Lay out the rule below a pull request's header to the main view's width

The rule was as wide as the main view was when the render was asked
for. If the layout then changed the width of the main view, the rule
came out too long or too short.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Stefan Haller
2026-10-05 16:38:13 +02:00
co-authored by Claude Opus 5.5
parent 5235083bd2
commit 576017c00b
+4 -2
View File
@@ -210,8 +210,10 @@ func (self *BranchesController) GetOnRenderToMain() func() {
pr, ok := self.c.Helpers().Host.PullRequestForBranch(branch.Name)
if ok && presentation.ShouldShowPrForBranch(pr, branch.Name, self.c.UserConfig()) {
rendererTask.Prefix = types.StaticPrefix(presentation.FormatPullRequestHeader(pr, self.c.Tr) +
strings.Repeat("─", self.c.Contexts().Normal.GetView().InnerWidth()) + "\n")
header := presentation.FormatPullRequestHeader(pr, self.c.Tr)
rendererTask.Prefix = types.PrefixForWidth(func(width int) string {
return header + strings.Repeat("─", width) + "\n"
})
}
}