sfm

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

commit fb21a55d103686e90d8afe31f9248f6226981df1
parent 39ac81012ef13e47abec3a7a575d5a3880507694
Author: afify <hassan@afify.dev>
Date:   Fri,  4 Dec 2020 07:12:38 +0300

[fix] mvfor save parent_firstrow

problem: moving back highlight parent row, but set firstrow 0
solution: move forward save parent_firstrow
	and mvbk set firstrow = parent_firstrow

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

diff --git a/sfm.c b/sfm.c @@ -62,6 +62,7 @@ typedef struct { int dirc; // dir entries sum int hdir; // highlighted dir int firstrow; + int parent_firstrow; int parent_row; // FIX int *selection; Cpair dircol; @@ -852,10 +853,11 @@ mvbk(void) } rmwatch(cpane); - cpane->firstrow = 0; + cpane->firstrow = cpane->parent_firstrow; cpane->hdir = cpane->parent_row; if (listdir(AddHi, NULL) < 0) print_error(strerror(errno)); + cpane->parent_firstrow = 0; cpane->parent_row = 1; } @@ -924,6 +926,7 @@ mvfor(void) case 0: strcpy(cpane->dirn, CURSOR_NAME); cpane->parent_row = cpane->hdir; + cpane->parent_firstrow = cpane->firstrow; cpane->hdir = 1; cpane->firstrow = 0; if (listdir(AddHi, NULL) < 0)