Skip to content

Commit 89ba3f2

Browse files
authored
Fix truncation of branches when scrolling branches panel to the left (#4483)
- **PR Description** Truncation of long branch names didn't take the horizontal scroll position into account; when scrolling the panel to the left using `H`, the long names were truncated way before the right edge of the view.
2 parents 0236682 + fa9d758 commit 89ba3f2

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

pkg/gui/context/branches_context.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func NewBranchesContext(c *ContextCommon) *BranchesContext {
3030
c.State().GetItemOperation,
3131
c.State().GetRepoState().GetScreenMode() != types.SCREEN_NORMAL,
3232
c.Modes().Diffing.Ref,
33-
c.Views().Branches.InnerWidth(),
33+
c.Views().Branches.InnerWidth()+c.Views().Branches.OriginX(),
3434
c.Tr,
3535
c.UserConfig(),
3636
c.Model().Worktrees,

pkg/gui/controllers/list_controller.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ func (self *ListController) scrollHorizontal(scrollFunc func()) error {
7474
scrollFunc()
7575

7676
self.context.HandleFocus(types.OnFocusOpts{})
77+
if self.context.NeedsRerenderOnWidthChange() == types.NEEDS_RERENDER_ON_WIDTH_CHANGE_WHEN_WIDTH_CHANGES {
78+
self.context.HandleRender()
79+
}
7780
return nil
7881
}
7982

0 commit comments

Comments
 (0)