diff options
| author | verdant <im@verdant.ee> | 2026-07-28 14:40:38 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-28 14:46:21 +0800 |
| commit | 81f3312cc234af234d325f40362e08777a4ffe35 (patch) | |
| tree | c6ab12dce5334d6fb7e285701bb60cfa325b38a8 | |
| parent | 817d03e9a1f88ea09bf4b90b2d1f60ae88ed195e (diff) | |
| download | sf-81f3312cc234af234d325f40362e08777a4ffe35.tar.gz sf-81f3312cc234af234d325f40362e08777a4ffe35.zip | |
Remove varaible "need_redraw" in fm_info, use global variable
| -rw-r--r-- | fm.c | 9 | ||||
| -rw-r--r-- | fm.h | 1 | ||||
| -rw-r--r-- | keys.c | 2 |
3 files changed, 6 insertions, 6 deletions
@@ -17,6 +17,7 @@ #include <unistd.h> static magic_t g_magic_ctx = NULL; +bool need_redraw = true; /* Function forward declarations */ static fm_info *fm_w_init(terminal *term); @@ -53,7 +54,7 @@ static fm_info *fm_w_init(terminal *term) info->top = 0; info->bottom = pane_height; - info->need_redraw = true; + need_redraw = true; return info; } @@ -230,7 +231,7 @@ void fm_entries_scroll(fm_info *info, int n) info->bottom = info->top + win_height; } - info->need_redraw = true; + need_redraw = true; } static void fm_reset_windows_data(fm_info *i) @@ -274,7 +275,7 @@ void fm_cd_up(fm_info *info) info->cursor = 0; info->top = 0; info->bottom = info->windows[FM_PANE_LEFT]->height; - info->need_redraw = true; + need_redraw = true; } void fm_cd_down(fm_info *info) @@ -311,7 +312,7 @@ void fm_cd_down(fm_info *info) info->cursor = 0; info->top = 0; - info->need_redraw = true; + need_redraw = true; } free(next_dir); @@ -33,7 +33,6 @@ typedef struct { char got_dir[PATH_MAX]; char cwd[PATH_MAX]; int top, bottom; - bool need_redraw; } fm_info; file_list *fm_getdir(file_list *list, const char *path); @@ -39,5 +39,5 @@ void handling_keys(int ch, fm_info *i) return; } - i->need_redraw = true; + need_redraw = true; } |
