fix: use total num of projects as max

This commit is contained in:
Daylin Morgan 2023-10-02 12:06:13 -05:00
parent b6065f0ef5
commit cca580fd12
Signed by: daylin
GPG key ID: C1E52E7DD81DF79F

View file

@ -134,7 +134,7 @@ proc addProjectCount(b: var Buffer) =
let
maxNumProjects = state.buffer.height - state.buffer.inputPad
numProjects = state.projects.len
b.addLine $(fmt"[[{state.projectIdx+1}-{state.projectIdx + maxNumProjects}/{numProjects}]".bb("faint"))
b.addLine $(fmt"[[{state.projectIdx+1}-{state.projectIdx + min(maxNumProjects, numProjects)}/{numProjects}]".bb("faint"))
proc addProjects(b: var Buffer) =
let