src/nnn.c | 17 +++++++++-------- diff --git a/src/nnn.c b/src/nnn.c index 82b3fcf85580053f58be3a0d8e40c83c71b070f4..a217d6b15f4f7f83390d42caaf66b32e667dc692 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -6577,14 +6577,15 @@ watch = FALSE; } #endif - if (cfgsort[cfg.curctx] == 'z') - set_sort_flags('c'); - if (order && (!cfgsort[cfg.curctx] || (cfgsort[cfg.curctx] == 'c')) - && ((r = get_kv_key(order, path, maxorder, NNN_ORDER)) > 0)) { - set_sort_flags(r); - cfgsort[cfg.curctx] = 'z'; - } - if (cfgsort[cfg.curctx] == '0') + if (cfgsort[cfg.curctx] != '0') { + if (cfgsort[cfg.curctx] == 'z') + set_sort_flags('c'); + if (order && (!cfgsort[cfg.curctx] || (cfgsort[cfg.curctx] == 'c')) + && ((r = get_kv_key(order, path, maxorder, NNN_ORDER)) > 0)) { + set_sort_flags(r); + cfgsort[cfg.curctx] = 'z'; + } + } else cfgsort[cfg.curctx] = cfgsort[CTX_MAX]; populate(path, lastname);