From cca580fd12b90d6f87cfc72d2fb44cadbfb3b9be Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Mon, 2 Oct 2023 12:06:13 -0500 Subject: [PATCH] fix: use total num of projects as max --- src/selector.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/selector.nim b/src/selector.nim index 1ffd1cd..25a114d 100644 --- a/src/selector.nim +++ b/src/selector.nim @@ -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