From 090dda23ad4ab87a68323a9e1924bc6d8ce6e0a6 Mon Sep 17 00:00:00 2001 From: Daylin Morgan Date: Wed, 20 Mar 2024 12:21:52 -0500 Subject: [PATCH] fix: don't extend beyond necessary max height --- src/selector.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/selector.nim b/src/selector.nim index 1bcb2f4..d8d2964 100644 --- a/src/selector.nim +++ b/src/selector.nim @@ -179,7 +179,11 @@ proc draw() = proc update(s: var State) = 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 proc clear(b: var Buffer) =