refactor: more readable syntax

This commit is contained in:
Daylin Morgan 2024-09-13 12:31:30 -05:00
parent 1a510de961
commit ad5dccfda1
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -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