fix: don't extend beyond necessary max height

This commit is contained in:
Daylin Morgan 2024-03-20 12:21:52 -05:00
parent 863391ce3c
commit 090dda23ad
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -179,7 +179,11 @@ proc draw() =
proc update(s: var State) = proc update(s: var State) =
s.buffer.width = terminalWidth() s.buffer.width = terminalWidth()
s.buffer.height = min(terminalHeight(), maxHeight + state.buffer.inputPad) s.buffer.height = min([
terminalHeight(),
maxHeight + state.buffer.inputPad,
state.buffer.inputPad + state.projects.len
])
s.cursor.max = s.buffer.height - state.buffer.inputPad s.cursor.max = s.buffer.height - state.buffer.inputPad
proc clear(b: var Buffer) = proc clear(b: var Buffer) =