diff options
| author | verdant <im@verdant.ee> | 2026-07-28 20:29:23 +0800 |
|---|---|---|
| committer | verdant <im@verdant.ee> | 2026-07-28 20:44:30 +0800 |
| commit | 1b5a26716b7d9050334d8ded58fe2c6ae7fe0143 (patch) | |
| tree | 8e50d8c492add5195edde7321256ea2c626bdf90 /src/fm.c | |
| parent | fe4f50f407c388dc0e6e77f4bb191f88058d5305 (diff) | |
| download | sf-1b5a26716b7d9050334d8ded58fe2c6ae7fe0143.tar.gz sf-1b5a26716b7d9050334d8ded58fe2c6ae7fe0143.zip | |
Reset view state only on successful directory load
Diffstat (limited to 'src/fm.c')
| -rw-r--r-- | src/fm.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -371,12 +371,13 @@ fm_cd_up(fm_info *info) file_list *new_list = fm_getdir(info->cur, info->cwd); if (new_list) { info->cur = new_list; + info->cursor = 0; + info->top = 0; + info->bottom = info->windows[FM_PANE_LEFT]->height; + need_redraw = true; + } else { + return; } - - info->cursor = 0; - info->top = 0; - info->bottom = info->windows[FM_PANE_LEFT]->height; - need_redraw = true; } void @@ -410,11 +411,13 @@ fm_cd_down(fm_info *info) file_list *new_list = fm_getdir(info->cur, info->cwd); if (new_list) { info->cur = new_list; + info->cursor = 0; + info->top = 0; + need_redraw = true; + } else { + free(next_dir); + return; } - - info->cursor = 0; - info->top = 0; - need_redraw = true; } free(next_dir); |
