From b603643132398d4e3f0b94865ec15782043380b5 Mon Sep 17 00:00:00 2001 From: verdant Date: Tue, 28 Jul 2026 20:44:44 +0800 Subject: Simplify directory preview logic with fm_preview_dir --- src/main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/main.c b/src/main.c index ba19c05..c1b327a 100644 --- a/src/main.c +++ b/src/main.c @@ -87,20 +87,11 @@ main(int argc, char **argv) size_t len = snprintf( next_path, sizeof(next_path), "%s/%s", info->cwd, info->cur->items[info->cursor].name); - if (len >= sizeof(next_path)) { die("Length of items error"); } - 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); - } + + fm_preview_dir(info, next_path); } draw_status_bar(term->windows[stat_bar_win_index], info->cwd, -- cgit v1.2.3