mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
restore sort function pointers when restoring cfg
This commit is contained in:
parent
9259170afd
commit
703d349389
13
src/nnn.c
13
src/nnn.c
|
@ -4308,6 +4308,9 @@ static void savecurctx(char *path, char *curname, int nextctx)
|
||||||
|
|
||||||
tmpcfg.curctx = nextctx;
|
tmpcfg.curctx = nextctx;
|
||||||
cfg = tmpcfg;
|
cfg = tmpcfg;
|
||||||
|
/* Restore the global function pointers alongside the cfg. */
|
||||||
|
entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
|
||||||
|
namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef NOSSN
|
#ifndef NOSSN
|
||||||
|
@ -6248,11 +6251,8 @@ static int set_sort_flags(int r)
|
||||||
r = 'd';
|
r = 'd';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg.version)
|
entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
|
||||||
namecmpfn = &xstrverscasecmp;
|
namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
|
||||||
|
|
||||||
if (cfg.reverse)
|
|
||||||
entrycmpfn = &reventrycmp;
|
|
||||||
} else if (r == CONTROL('T')) {
|
} else if (r == CONTROL('T')) {
|
||||||
/* Cycling order: clear -> size -> time -> clear */
|
/* Cycling order: clear -> size -> time -> clear */
|
||||||
if (cfg.timeorder)
|
if (cfg.timeorder)
|
||||||
|
@ -8018,6 +8018,9 @@ nochange:
|
||||||
lastname = g_ctx[r].c_name;
|
lastname = g_ctx[r].c_name;
|
||||||
|
|
||||||
cfg = g_ctx[r].c_cfg;
|
cfg = g_ctx[r].c_cfg;
|
||||||
|
/* Restore the global function pointers alongside the cfg. */
|
||||||
|
entrycmpfn = cfg.reverse ? &reventrycmp : &entrycmp;
|
||||||
|
namecmpfn = cfg.version ? &xstrverscasecmp : &xstricmp;
|
||||||
|
|
||||||
cfg.curctx = r;
|
cfg.curctx = r;
|
||||||
setdirwatch();
|
setdirwatch();
|
||||||
|
|
Loading…
Reference in a new issue