aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fm.c1
-rw-r--r--main.c16
2 files changed, 16 insertions, 1 deletions
diff --git a/fm.c b/fm.c
index e03ac57..a4a9c3d 100644
--- a/fm.c
+++ b/fm.c
@@ -102,6 +102,7 @@ file_list *fm_getdir(file_list *list, const char *path)
if (new_list->items && new_list->cap > 0) {
LOG_WRITE_INFO("Initialize list");
memset(new_list->items, 0, new_list->cap * sizeof(file_item));
+ new_list->count = 0;
}
struct dirent *d;
diff --git a/main.c b/main.c
index 67a2ad9..63f012e 100644
--- a/main.c
+++ b/main.c
@@ -67,11 +67,25 @@ int main(int argc, char **argv)
info->cur->items[info->cursor].name);
fm_preview_file(info->windows[FM_PANE_RIGHT],
next_path);
+ } else {
+ snprintf(next_path, sizeof(next_path), "%s/%s",
+ info->cwd,
+ info->cur->items[info->cursor].name);
+ file_list *new_list = info->next;
+ new_list = fm_getdir(new_list, next_path);
+ if (new_list) {
+ info->next = new_list;
+ int right_height =
+ info->windows[FM_PANE_RIGHT]
+ ->height;
+ fm_draw_entries(
+ info->windows[FM_PANE_RIGHT],
+ info->next, -1, 0, right_height);
+ }
}
wrefresh(info->windows[FM_PANE_RIGHT]->win);
wrefresh(info->windows[FM_PANE_LEFT]->win);
- refresh();
}
ch = getch();