Fix browsing right after opening a file directly

This commit is contained in:
Přemysl Eric Janouch 2021-11-22 12:41:53 +01:00
parent a719147bf3
commit 97109b1e58
Signed by: p
GPG Key ID: A0420B94F92B9493

View File

@ -208,7 +208,8 @@ open(const gchar *path)
// So that load_directory() itself can be used for reloading. // So that load_directory() itself can be used for reloading.
gchar *dirname = g_path_get_dirname(path); gchar *dirname = g_path_get_dirname(path);
if (!g.directory || strcmp(dirname, g.directory)) { if (!g.files->len /* hack to always load the directory after launch */ ||
!g.directory || strcmp(dirname, g.directory)) {
load_directory(dirname); load_directory(dirname);
} else { } else {
g.files_index = -1; g.files_index = -1;