]> Sergey Matveev's repositories - nnn.git/commitdiff
Open previous active context on context quit
authorArun Prakash Jana <engineerarun@gmail.com>
Sat, 5 Feb 2022 18:53:45 +0000 (00:23 +0530)
committerArun Prakash Jana <engineerarun@gmail.com>
Sat, 5 Feb 2022 18:53:45 +0000 (00:23 +0530)
src/nnn.c

index 8673207e4b781776402290059dd02246dc0721c2..4977ff083616b570f42763c35fa5a094d5d9fbd2 100644 (file)
--- 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) {