sfm

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

commit 3305c44909d940566a1e2c018b36a54131d0c629
parent 38bb618c7b31e4f9a21608ff6915e95c715c50f5
Author: afify <hassan@afify.dev>
Date:   Mon, 28 Sep 2020 23:35:42 +0300

[fix] resize & openfiles, cursor position

problem 1: t_resize() call set_panes() with arg PtP "part of the pane"
	which should keep the pane.firstrow.
problem 2: after exiting opnf(), t_resize() is called
	same as problem 1.

solution: in set_panes() move paneX.firstrow if AllP arg is set.

Diffstat:
Msfm.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/sfm.c b/sfm.c @@ -1087,7 +1087,7 @@ scrdwns(void) refresh_pane(); add_hi(cpane, cpane->hdir - 1); } else { - if (cpane->hdir < cpane->dirc - scrmv) { + if (cpane->hdir < cpane->dirc - scrmv - 1) { rm_hi(cpane, cpane->hdir - 1); cpane->hdir += scrmv; add_hi(cpane, cpane->hdir - 1); @@ -1662,8 +1662,8 @@ set_panes(int paneitem) pane_l.pane_id = 0; pane_l.dirx = 2; pane_l.dircol = cpanell; - pane_l.firstrow = 0; if (paneitem == AllP) { + pane_l.firstrow = 0; pane_l.direntr = ecalloc(0, sizeof(Entry)); strcpy(pane_l.dirn, cwd); pane_l.hdir = 1; @@ -1673,8 +1673,8 @@ set_panes(int paneitem) pane_r.pane_id = 1; pane_r.dirx = (width / 2) + 2; pane_r.dircol = cpanelr; - pane_r.firstrow = 0; if (paneitem == AllP) { + pane_r.firstrow = 0; pane_r.direntr = ecalloc(0, sizeof(Entry)); strcpy(pane_r.dirn, home); pane_r.hdir = 1;