diff options
| author | Fuwn <[email protected]> | 2026-02-11 04:20:56 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-11 04:20:56 +0000 |
| commit | ccb25641712cc61fe30438c64313c6a1434b7966 (patch) | |
| tree | 2a8f456cbcdafb6658fd558f3a236dc1a4287219 /internal/app/view.go | |
| parent | docs(README): Add instructions to run with Nix (diff) | |
| download | faustus-main.tar.xz faustus-main.zip | |
Diffstat (limited to 'internal/app/view.go')
| -rw-r--r-- | internal/app/view.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/internal/app/view.go b/internal/app/view.go index 1f9fb4b..a726dae 100644 --- a/internal/app/view.go +++ b/internal/app/view.go @@ -390,9 +390,9 @@ func (m Model) renderList() string { var builder strings.Builder - listHeight := m.listHeight() + visible := m.visibleItemCount() - for index := m.offset; index < min(m.offset+listHeight, len(m.filtered)); index++ { + for index := m.offset; index < min(m.offset+visible, len(m.filtered)); index++ { session := m.filtered[index] isSelected := index == m.cursor @@ -400,9 +400,9 @@ func (m Model) renderList() string { builder.WriteString("\n") } - if len(m.filtered) > listHeight { - position := float64(m.offset) / float64(len(m.filtered)-listHeight) - indicator := fmt.Sprintf(" [%d-%d of %d]", m.offset+1, min(m.offset+listHeight, len(m.filtered)), len(m.filtered)) + if len(m.filtered) > visible { + position := float64(m.offset) / float64(len(m.filtered)-visible) + indicator := fmt.Sprintf(" [%d-%d of %d]", m.offset+1, min(m.offset+visible, len(m.filtered)), len(m.filtered)) builder.WriteString(ui.MetaStyle.Render(indicator)) |