mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 20:01:27 +00:00
Minor refactor
This commit is contained in:
parent
c5ff2f5647
commit
0b1c87758c
13
src/nnn.c
13
src/nnn.c
|
@ -117,7 +117,7 @@
|
||||||
#define _ABSSUB(N, M) (((N) <= (M)) ? ((M) - (N)) : ((N) - (M)))
|
#define _ABSSUB(N, M) (((N) <= (M)) ? ((M) - (N)) : ((N) - (M)))
|
||||||
#define DOUBLECLICK_INTERVAL_NS (400000000)
|
#define DOUBLECLICK_INTERVAL_NS (400000000)
|
||||||
#define XDELAY_INTERVAL_MS (350000) /* 350 ms delay */
|
#define XDELAY_INTERVAL_MS (350000) /* 350 ms delay */
|
||||||
#define LEN(x) (sizeof(x) / sizeof(*(x)))
|
#define ELEMENTS(x) (sizeof(x) / sizeof(*(x)))
|
||||||
#undef MIN
|
#undef MIN
|
||||||
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
#define MIN(x, y) ((x) < (y) ? (x) : (y))
|
||||||
#undef MAX
|
#undef MAX
|
||||||
|
@ -1894,7 +1894,6 @@ static int nextsel(int presel)
|
||||||
{
|
{
|
||||||
int c = presel;
|
int c = presel;
|
||||||
uint i;
|
uint i;
|
||||||
const uint len = LEN(bindings);
|
|
||||||
#ifdef LINUX_INOTIFY
|
#ifdef LINUX_INOTIFY
|
||||||
struct inotify_event *event;
|
struct inotify_event *event;
|
||||||
char inotify_buf[EVENT_BUF_LEN];
|
char inotify_buf[EVENT_BUF_LEN];
|
||||||
|
@ -1917,12 +1916,8 @@ static int nextsel(int presel)
|
||||||
if (c == FILTER)
|
if (c == FILTER)
|
||||||
clearfilter();
|
clearfilter();
|
||||||
|
|
||||||
if (presel == MSGWAIT) {
|
if (presel == MSGWAIT)
|
||||||
if (cfg.filtermode)
|
c = (cfg.filtermode) ? FILTER : CONTROL('L');
|
||||||
c = FILTER;
|
|
||||||
else
|
|
||||||
c = CONTROL('L');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (c == -1) {
|
if (c == -1) {
|
||||||
|
@ -1969,7 +1964,7 @@ static int nextsel(int presel)
|
||||||
} else
|
} else
|
||||||
idle = 0;
|
idle = 0;
|
||||||
|
|
||||||
for (i = 0; i < len; ++i)
|
for (i = 0; i < ELEMENTS(bindings); ++i)
|
||||||
if (c == bindings[i].sym)
|
if (c == bindings[i].sym)
|
||||||
return bindings[i].act;
|
return bindings[i].act;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue