From 7da62d8a265014406482353e028d230ea4d06f1a Mon Sep 17 00:00:00 2001 From: Marcel Rodrigues Date: Sun, 9 Aug 2015 14:04:27 -0300 Subject: [PATCH] Fix scroll after deleting files on background tab. --- rover.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rover.c b/rover.c index d39d9d4..145e353 100644 --- a/rover.c +++ b/rover.c @@ -377,7 +377,10 @@ update_view() ESEL = MAX(MIN(ESEL, rover.nfiles - 1), 0); /* Selection might not be visible, due to cursor wrapping or window shrinking. In that case, the scroll must be moved to make it visible. */ - SCROLL = MAX(MIN(SCROLL, ESEL), ESEL - HEIGHT + 1); + if (rover.nfiles > HEIGHT) + SCROLL = MAX(MIN(SCROLL, ESEL), ESEL - HEIGHT + 1); + else + SCROLL = 0; marking = !strcmp(CWD, rover.marks.dirpath); for (i = 0, j = SCROLL; i < HEIGHT && j < rover.nfiles; i++, j++) { ishidden = ENAME(j)[0] == '.'; -- 2.11.4.GIT