sfm

simple file manager
git clone git://git.afify.dev/sfm
Log | Files | Refs | README | LICENSE

commit 57a7881cd9308a6bac6d3713268ab3ef6b314ade
parent b6a4665be2e2f053fffbaf678b9397908ef1cd6e
Author: afify <hassan@afify.dev>
Date:   Sun, 23 Aug 2020 13:44:18 +0300

[fix] mv to middel bug

- if directory entries < terminal height:
	mv cursor to directory count / 2

Diffstat:
Msfm.c | 5++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git 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(); }