Skip to content

Commit

Permalink
Remove a magic number when determining repo height
Browse files Browse the repository at this point in the history
  • Loading branch information
meowgorithm committed Sep 17, 2021
1 parent 1dbf20d commit 4b93e2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tui/bubbles/repo/bubble.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (b *Bubble) SetSize(w, h int) {
b.width = w
b.height = h
b.readmeViewport.Viewport.Width = w - b.widthMargin
b.readmeViewport.Viewport.Height = h - b.heightMargin
b.readmeViewport.Viewport.Height = h - lipgloss.Height(b.headerView()) - b.heightMargin
}

func (b *Bubble) GotoTop() {
Expand Down
3 changes: 1 addition & 2 deletions tui/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func (b *Bubble) setupCmd() tea.Msg {
var heightMargin = lipgloss.Height(b.headerView()) +
lipgloss.Height(b.footerView()) +
b.styles.RepoBody.GetVerticalFrameSize() +
b.styles.App.GetVerticalMargins() +
3 // TODO: make this dynamic (this is the height of the repo info)
b.styles.App.GetVerticalMargins()
rb := repo.NewBubble(b.repoSource, me.Repo, b.styles, width, boxLeftWidth, b.height, heightMargin, tmplConfig)
rb.Host = b.config.Host
rb.Port = b.config.Port
Expand Down

0 comments on commit 4b93e2e

Please sign in to comment.