diff options
| author | verdant <im@verdant.ee> | 2026-07-27 09:47:14 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-27 09:47:14 +0800 |
| commit | 16ca576eefc6bb3fe85a6e6e58521b99d5b9fe47 (patch) | |
| tree | b2b7211fd6353aaaae55d4c7a18a65a958aac36b /main.c | |
| parent | 24d8ea35f1f138195a4ad874dbbf2d23a450251c (diff) | |
| download | sf-16ca576eefc6bb3fe85a6e6e58521b99d5b9fe47.tar.gz sf-16ca576eefc6bb3fe85a6e6e58521b99d5b9fe47.zip | |
Implement directory preview
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -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(); |
