From 57a7881cd9308a6bac6d3713268ab3ef6b314ade Mon Sep 17 00:00:00 2001 From: afify Date: Sun, 23 Aug 2020 13:44:18 +0300 Subject: [PATCH] [fix] mv to middel bug - if directory entries < terminal height: mv cursor to directory count / 2 --- sfm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sfm.c b/sfm.c index 065daf1..e96dcd3 100644 --- a/sfm.c +++ b/sfm.c @@ -997,7 +997,10 @@ mvmid(void) if (cpane->dirc < 1) return; rm_hi(cpane, cpane->hdir - 1); - cpane->hdir = (scrheight / 2) + cpane->firstrow; + if (cpane->dirc < scrheight / 2) + cpane->hdir = (cpane->dirc + 1) / 2; + else + cpane->hdir = (scrheight / 2) + cpane->firstrow; add_hi(cpane, cpane->hdir - 1); print_info(); } -- 2.11.4.GIT