From 23b54ba0cf968d7c3c5973642186223c70aa9cf6 Mon Sep 17 00:00:00 2001 From: Arun Prakash Jana Date: Sun, 6 Feb 2022 00:23:45 +0530 Subject: [PATCH] Open previous active context on context quit --- src/nnn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nnn.c b/src/nnn.c index 8673207e..4977ff08 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -7804,9 +7804,9 @@ nochange: if (sel == SEL_QUITCTX) { int ctx = cfg.curctx; - for (r = (ctx + 1) & ~CTX_MAX; + for (r = (ctx - 1) & (CTX_MAX - 1); (r != ctx) && !g_ctx[r].c_cfg.ctxactive; - r = ((r + 1) & ~CTX_MAX)) { + r = ((r - 1) & (CTX_MAX - 1))) { }; if (r != ctx) {