commit ddf996b8f35253bbb2509bff03e5c4e7cc056010
parent 820448916f944175130c12b16a0cd6a6aae7b433
Author: Quentin Rameau <quinq@fifth.space>
Date: Thu, 22 Feb 2018 18:23:33 +0100
Improve terminal resizing when current line is over term size
Diffstat:
1 file changed, 8 insertions(+), 0 deletions(-)
diff --git a/ui_ti.c b/ui_ti.c
@@ -543,8 +543,16 @@ uiselectitem(Item *entry)
void
uisigwinch(int signal)
{
+ Dir *dir;
+
setupterm(NULL, 1, NULL);
putp(tparm(change_scroll_region, 0, lines-2));
+ if (!curentry || !(dir = curentry->dat))
+ return;
+
+ if (dir->curline - dir->printoff > lines-2)
+ dir->curline = dir->printoff + lines-2;
+
uidisplay(curentry);
}