mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
Remove dir watch before filtering contents
This commit is contained in:
parent
f3578247eb
commit
81318f9218
27
src/nnn.c
27
src/nnn.c
|
@ -1249,21 +1249,8 @@ static int nextsel(int *presel)
|
||||||
if (c == 0) {
|
if (c == 0) {
|
||||||
c = getch();
|
c = getch();
|
||||||
DPRINTF_D(c);
|
DPRINTF_D(c);
|
||||||
} else {
|
} else
|
||||||
/* Unwatch dir if we are still in a filtered view */
|
|
||||||
#ifdef LINUX_INOTIFY
|
|
||||||
if (*presel == FILTER && inotify_wd >= 0) {
|
|
||||||
inotify_rm_watch(inotify_fd, inotify_wd);
|
|
||||||
inotify_wd = -1;
|
|
||||||
}
|
|
||||||
#elif defined(BSD_KQUEUE)
|
|
||||||
if (*presel == FILTER && event_fd >= 0) {
|
|
||||||
close(event_fd);
|
|
||||||
event_fd = -1;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
*presel = 0;
|
*presel = 0;
|
||||||
}
|
|
||||||
|
|
||||||
if (c == -1) {
|
if (c == -1) {
|
||||||
++idle;
|
++idle;
|
||||||
|
@ -3144,6 +3131,18 @@ nochange:
|
||||||
printmsg(mark);
|
printmsg(mark);
|
||||||
goto nochange;
|
goto nochange;
|
||||||
case SEL_FLTR:
|
case SEL_FLTR:
|
||||||
|
/* Unwatch dir if we are still in a filtered view */
|
||||||
|
#ifdef LINUX_INOTIFY
|
||||||
|
if (inotify_wd >= 0) {
|
||||||
|
inotify_rm_watch(inotify_fd, inotify_wd);
|
||||||
|
inotify_wd = -1;
|
||||||
|
}
|
||||||
|
#elif defined(BSD_KQUEUE)
|
||||||
|
if (event_fd >= 0) {
|
||||||
|
close(event_fd);
|
||||||
|
event_fd = -1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
presel = filterentries(path);
|
presel = filterentries(path);
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
if (ndents)
|
||||||
|
|
Loading…
Reference in a new issue