aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorverdant <im@verdant.ee>2026-07-28 20:44:44 +0800
committerverdant <im@verdant.ee>2026-07-28 20:44:44 +0800
commitb603643132398d4e3f0b94865ec15782043380b5 (patch)
tree56fa486e8d4091e88a0b009d0b4072334a43614a
parent4998ffdca7c38afa23bb7f83ce0386bead9ebe38 (diff)
downloadsf-b603643132398d4e3f0b94865ec15782043380b5.tar.gz
sf-b603643132398d4e3f0b94865ec15782043380b5.zip
Simplify directory preview logic with fm_preview_dir
-rw-r--r--src/main.c13
1 files 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,