From 80ac2501501f83f7c64a5591b2075468a5fab6b5 Mon Sep 17 00:00:00 2001 From: verdant Date: Thu, 23 Jul 2026 18:58:40 +0800 Subject: Add scroll state and redraw tracking to fm_info --- fm.c | 6 ++++++ fm.h | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/fm.c b/fm.c index afc7d08..66e588f 100644 --- a/fm.c +++ b/fm.c @@ -42,6 +42,12 @@ static fm_info *fm_w_init(terminal *t) f->fm_r->start_x = fm_r_startx; f->fm_r->win = fm_r->win; + f->top = 0; + f->bottom = fm_h - 1; + log_write(LOG_INFO, "t->windows[i]->height = %d", + t->windows[i]->height); + f->margin_bottom = 3; + f->needs_redraw = 1; return f; } void fm_getdir(fm_info *f); diff --git a/fm.h b/fm.h index a7c5748..06de931 100644 --- a/fm.h +++ b/fm.h @@ -2,6 +2,7 @@ #define SF_FM_H #include +#include #include #include "wm.h" @@ -15,11 +16,18 @@ typedef struct { file_item *items; int count; int cap; +} file_list; + +typedef struct { + file_list *cur; + file_list *next; int selected_idx; window *fm_l, *fm_r; - char **cur_contents; - char **next_dir_contents; + int got_next_dir; + char got_dir[PATH_MAX]; char cwd[PATH_MAX]; + int top, bottom, margin_bottom; + int needs_redraw; } fm_info; void fm_getdir(fm_info *f); -- cgit v1.2.3