mirror of https://github.com/jarun/nnn.git
Support copymode across contexts
This commit is contained in:
parent
4ceb0800e4
commit
f9264577d2
|
@ -2139,6 +2139,7 @@ static void (*printptr)(const struct entry *ent, int sel, uint namecols) = &prin
|
||||||
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
|
static void savecurctx(settings *curcfg, char *path, char *curname, int r /* next context num */)
|
||||||
{
|
{
|
||||||
settings cfg = *curcfg;
|
settings cfg = *curcfg;
|
||||||
|
bool copymode = cfg.copymode ? TRUE : FALSE;
|
||||||
|
|
||||||
#ifdef DIR_LIMITED_COPY
|
#ifdef DIR_LIMITED_COPY
|
||||||
g_crc = 0;
|
g_crc = 0;
|
||||||
|
@ -2164,6 +2165,8 @@ static void savecurctx(settings *curcfg, char *path, char *curname, int r /* nex
|
||||||
g_ctx[r].c_cfg.runplugin = 0;
|
g_ctx[r].c_cfg.runplugin = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Continue copy mode */
|
||||||
|
cfg.copymode = copymode;
|
||||||
cfg.curctx = r;
|
cfg.curctx = r;
|
||||||
|
|
||||||
*curcfg = cfg;
|
*curcfg = cfg;
|
||||||
|
@ -4002,13 +4005,15 @@ nochange:
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case SEL_QUITCTX:
|
case SEL_QUITCTX:
|
||||||
fd = cfg.curctx;
|
fd = cfg.curctx; /* fd used as tmp var */
|
||||||
for (r = (fd + 1) & ~CTX_MAX;
|
for (r = (fd + 1) & ~CTX_MAX;
|
||||||
(r != fd) && !g_ctx[r].c_cfg.ctxactive;
|
(r != fd) && !g_ctx[r].c_cfg.ctxactive;
|
||||||
r = ((r + 1) & ~CTX_MAX)) {
|
r = ((r + 1) & ~CTX_MAX)) {
|
||||||
};
|
};
|
||||||
|
|
||||||
if (r != fd) {
|
if (r != fd) {
|
||||||
|
bool copymode = cfg.copymode ? TRUE : FALSE;
|
||||||
|
|
||||||
g_ctx[fd].c_cfg.ctxactive = 0;
|
g_ctx[fd].c_cfg.ctxactive = 0;
|
||||||
|
|
||||||
/* Switch to next active context */
|
/* Switch to next active context */
|
||||||
|
@ -4023,6 +4028,8 @@ nochange:
|
||||||
|
|
||||||
cfg = g_ctx[r].c_cfg;
|
cfg = g_ctx[r].c_cfg;
|
||||||
|
|
||||||
|
/* Continue copy mode */
|
||||||
|
cfg.copymode = copymode;
|
||||||
cfg.curctx = r;
|
cfg.curctx = r;
|
||||||
setdirwatch();
|
setdirwatch();
|
||||||
goto begin;
|
goto begin;
|
||||||
|
|
Loading…
Reference in New Issue