Improve terminal resizing when current line is over term size - sacc - sacc(omys), simple console gopher client HTML git clone git://bitreich.org/sacc/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/sacc/ DIR Log DIR Files DIR Refs DIR Tags DIR LICENSE --- DIR commit ddf996b8f35253bbb2509bff03e5c4e7cc056010 DIR parent 820448916f944175130c12b16a0cd6a6aae7b433 HTML 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: M ui_ti.c | 8 ++++++++ 1 file changed, 8 insertions(+), 0 deletions(-) --- DIR 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); }