mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Selection should work across contexts
This commit is contained in:
parent
ef88a31a7c
commit
0a5dc2e336
14
src/nnn.c
14
src/nnn.c
|
@ -936,7 +936,8 @@ static bool listselbuf(const char *path, char *newpath)
|
||||||
size_t pos;
|
size_t pos;
|
||||||
uint oldpos = selbufpos;
|
uint oldpos = selbufpos;
|
||||||
|
|
||||||
updateselbuf(path, newpath);
|
if (cfg.selmode)
|
||||||
|
updateselbuf(path, newpath);
|
||||||
|
|
||||||
if (!selbufpos)
|
if (!selbufpos)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
@ -4141,7 +4142,7 @@ static void browse(char *ipath, const char *session)
|
||||||
char *path, *lastdir, *lastname, *dir, *tmp;
|
char *path, *lastdir, *lastname, *dir, *tmp;
|
||||||
MEVENT event;
|
MEVENT event;
|
||||||
struct timespec mousetimings[2] = {{.tv_sec = 0, .tv_nsec = 0}, {.tv_sec = 0, .tv_nsec = 0} };
|
struct timespec mousetimings[2] = {{.tv_sec = 0, .tv_nsec = 0}, {.tv_sec = 0, .tv_nsec = 0} };
|
||||||
bool currentmouse = 1;
|
bool currentmouse = 1, ctx_changed = FALSE;
|
||||||
|
|
||||||
atexit(dentfree);
|
atexit(dentfree);
|
||||||
|
|
||||||
|
@ -4173,8 +4174,10 @@ static void browse(char *ipath, const char *session)
|
||||||
errexit();
|
errexit();
|
||||||
|
|
||||||
begin:
|
begin:
|
||||||
if (cfg.selmode && nselected && lastdir[0])
|
if (cfg.selmode && lastdir[0] && !ctx_changed)
|
||||||
updateselbuf(lastdir, newpath);
|
updateselbuf(lastdir, newpath);
|
||||||
|
else if (ctx_changed)
|
||||||
|
ctx_changed = FALSE;
|
||||||
|
|
||||||
#ifdef LINUX_INOTIFY
|
#ifdef LINUX_INOTIFY
|
||||||
if ((presel == FILTER || dir_changed) && inotify_wd >= 0) {
|
if ((presel == FILTER || dir_changed) && inotify_wd >= 0) {
|
||||||
|
@ -4577,6 +4580,11 @@ nochange:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cfg.selmode) {
|
||||||
|
updateselbuf(path, newpath);
|
||||||
|
ctx_changed = TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
savecurctx(&cfg, path, dents[cur].name, r);
|
savecurctx(&cfg, path, dents[cur].name, r);
|
||||||
|
|
||||||
/* Reset the pointers */
|
/* Reset the pointers */
|
||||||
|
|
Loading…
Reference in a new issue