From ad5dccfda137ead3ccbc93de4503a8d203f1e223 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Fri, 13 Sep 2024 12:31:30 -0500 Subject: [PATCH] refactor: more readable syntax --- src/selector.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/selector.nim b/src/selector.nim index e486979..b86dee0 100644 --- a/src/selector.nim +++ b/src/selector.nim @@ -150,7 +150,10 @@ proc addProjectCount(b: var Buffer) = maxNumProjects = state.buffer.height - state.buffer.inputPad numProjects = state.projects.len # TODO: use variables here for readability - b.addLine $(fmt"[[{state.projectIdx+1}-{state.projectIdx + min(maxNumProjects, numProjects)}/{numProjects}]".bb("faint")) + let + low= state.projectIdx+1 + high = state.projectIdx + min(maxNumProjects, numProjects) + b.addLine $(fmt"[[{low}-{high}/{numProjects}]".bb("faint")) proc addProjects(b: var Buffer) = let