mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 13:51:31 +00:00
Sync operation on selection among nnn instances
This commit is contained in:
parent
97ac88dec2
commit
06e2676421
21
src/nnn.c
21
src/nnn.c
|
@ -630,7 +630,7 @@ static const char * const messages[] = {
|
||||||
"session name: ",
|
"session name: ",
|
||||||
"'c'p / 'm'v as?",
|
"'c'p / 'm'v as?",
|
||||||
"'c'urrent / 's'el?",
|
"'c'urrent / 's'el?",
|
||||||
"%s %s file%s? [Esc cancels]",
|
"%s %s? [Esc cancels]",
|
||||||
"limit exceeded",
|
"limit exceeded",
|
||||||
"'f'ile / 'd'ir / 's'ym / 'h'ard?",
|
"'f'ile / 'd'ir / 's'ym / 'h'ard?",
|
||||||
"'c'li / 'g'ui?",
|
"'c'li / 'g'ui?",
|
||||||
|
@ -1409,7 +1409,7 @@ static char confirm_force(bool selection)
|
||||||
|
|
||||||
snprintf(str, 64, messages[MSG_FORCE_RM],
|
snprintf(str, 64, messages[MSG_FORCE_RM],
|
||||||
g_state.trash ? utils[UTIL_GIO_TRASH] + 4 : utils[UTIL_RM_RF],
|
g_state.trash ? utils[UTIL_GIO_TRASH] + 4 : utils[UTIL_RM_RF],
|
||||||
(selection ? xitoa(nselected) : "current"), (selection ? "(s)" : ""));
|
(selection ? "selection" : "hovered"));
|
||||||
|
|
||||||
int r = get_input(str);
|
int r = get_input(str);
|
||||||
|
|
||||||
|
@ -3043,7 +3043,7 @@ try_quit:
|
||||||
* Check for changes every odd second.
|
* Check for changes every odd second.
|
||||||
*/
|
*/
|
||||||
#ifdef LINUX_INOTIFY
|
#ifdef LINUX_INOTIFY
|
||||||
if (!g_state.selmode && !cfg.blkorder && inotify_wd >= 0 && (idle & 1)) {
|
if (!cfg.blkorder && inotify_wd >= 0 && (idle & 1)) {
|
||||||
struct inotify_event *event;
|
struct inotify_event *event;
|
||||||
char inotify_buf[EVENT_BUF_LEN];
|
char inotify_buf[EVENT_BUF_LEN];
|
||||||
|
|
||||||
|
@ -3061,6 +3061,8 @@ try_quit:
|
||||||
|
|
||||||
if (event->mask & INOTIFY_MASK) {
|
if (event->mask & INOTIFY_MASK) {
|
||||||
c = CONTROL('L');
|
c = CONTROL('L');
|
||||||
|
if (nselected && isselfileempty())
|
||||||
|
clearselection();
|
||||||
DPRINTF_S("issue refresh");
|
DPRINTF_S("issue refresh");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3069,18 +3071,23 @@ try_quit:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#elif defined(BSD_KQUEUE)
|
#elif defined(BSD_KQUEUE)
|
||||||
if (!g_state.selmode && !cfg.blkorder && event_fd >= 0 && idle & 1) {
|
if (!cfg.blkorder && event_fd >= 0 && (idle & 1)) {
|
||||||
struct kevent event_data[NUM_EVENT_SLOTS];
|
struct kevent event_data[NUM_EVENT_SLOTS];
|
||||||
|
|
||||||
memset((void *)event_data, 0x0, sizeof(struct kevent) * NUM_EVENT_SLOTS);
|
memset((void *)event_data, 0x0, sizeof(struct kevent) * NUM_EVENT_SLOTS);
|
||||||
if (kevent(kq, events_to_monitor, NUM_EVENT_SLOTS,
|
if (kevent(kq, events_to_monitor, NUM_EVENT_SLOTS,
|
||||||
event_data, NUM_EVENT_FDS, >imeout) > 0)
|
event_data, NUM_EVENT_FDS, >imeout) > 0) {
|
||||||
c = CONTROL('L');
|
c = CONTROL('L');
|
||||||
|
if (nselected && isselfileempty())
|
||||||
|
clearselection();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#elif defined(HAIKU_NM)
|
#elif defined(HAIKU_NM)
|
||||||
if (!g_state.selmode && !cfg.blkorder && haiku_nm_active
|
if (!cfg.blkorder && haiku_nm_active && (idle & 1) && haiku_is_update_needed(haiku_hnd)) {
|
||||||
&& (idle & 1) && haiku_is_update_needed(haiku_hnd))
|
|
||||||
c = CONTROL('L');
|
c = CONTROL('L');
|
||||||
|
if (nselected && isselfileempty())
|
||||||
|
clearselection();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
} else
|
} else
|
||||||
idle = 0;
|
idle = 0;
|
||||||
|
|
Loading…
Reference in a new issue