Merge pull request #1970 from doremiyeon/filter_function_restore_on_session_load

filter function restore on session load
This commit is contained in:
Arun Prakash Jana 2025-01-06 18:42:01 +05:30 committed by GitHub
commit e131f5f32b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -4409,6 +4409,7 @@ static void setcfg(settings newcfg)
/* Synchronize the global function pointers to match the new cfg. */ /* Synchronize the global function pointers to match the new cfg. */
entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp; entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp; namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
filterfn = cfg.regex ? &visible_re : &visible_str;
} }
static void savecurctx(char *path, char *curname, int nextctx) static void savecurctx(char *path, char *curname, int nextctx)
@ -4566,7 +4567,9 @@ static bool load_session(const char *sname, char **path, char **lastdir, char **
*path = g_ctx[cfg.curctx].c_path; *path = g_ctx[cfg.curctx].c_path;
*lastdir = g_ctx[cfg.curctx].c_last; *lastdir = g_ctx[cfg.curctx].c_last;
*lastname = g_ctx[cfg.curctx].c_name; *lastname = g_ctx[cfg.curctx].c_name;
set_sort_flags('\0'); /* Set correct sort options */ /* Set correct sort and filter options */
set_sort_flags('\0');
filterfn = cfg.regex ? &visible_re : &visible_str;
xstrsncpy(curssn, sname ? sname : "@", NAME_MAX); xstrsncpy(curssn, sname ? sname : "@", NAME_MAX);
status = TRUE; status = TRUE;