mirror of
https://github.com/jarun/nnn.git
synced 2025-03-12 17:54:04 +00:00
This commit is contained in:
parent
a7d224f1e5
commit
ab8e3e445e
1 changed files with 21 additions and 1 deletions
22
src/nnn.c
22
src/nnn.c
|
@ -4671,6 +4671,22 @@ nochange:
|
|||
}
|
||||
}
|
||||
|
||||
static void check_keybinding_collision(void)
|
||||
{
|
||||
unsigned long i;
|
||||
bool bitmap[KEY_MAX] = {FALSE};
|
||||
|
||||
for (i = 0; i < sizeof(bindings) / sizeof(struct key); ++i) {
|
||||
int curr_sym = bindings[i].sym;
|
||||
|
||||
if (bitmap[curr_sym])
|
||||
fprintf(stdout,
|
||||
"Collision of key %s detected\n", keyname(curr_sym));
|
||||
else
|
||||
bitmap[curr_sym] = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stdout,
|
||||
|
@ -4685,6 +4701,7 @@ static void usage(void)
|
|||
" -d detail mode\n"
|
||||
" -f run filter as cmd on prompt key\n"
|
||||
" -H show hidden files\n"
|
||||
" -K test for keybinding collision\n"
|
||||
" -i nav-as-you-type mode\n"
|
||||
" -n version sort\n"
|
||||
" -o open files on Enter\n"
|
||||
|
@ -4828,7 +4845,7 @@ int main(int argc, char *argv[])
|
|||
bool progress = FALSE;
|
||||
#endif
|
||||
|
||||
while ((opt = getopt(argc, argv, "HSiab:cdfnop:rstvh")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "HSKiab:cdfnop:rstvh")) != -1) {
|
||||
switch (opt) {
|
||||
case 'S':
|
||||
cfg.blkorder = 1;
|
||||
|
@ -4891,6 +4908,9 @@ int main(int argc, char *argv[])
|
|||
case 't':
|
||||
cfg.autoselect = 0;
|
||||
break;
|
||||
case 'K':
|
||||
check_keybinding_collision();
|
||||
return _SUCCESS;
|
||||
case 'v':
|
||||
fprintf(stdout, "%s\n", VERSION);
|
||||
return _SUCCESS;
|
||||
|
|
Loading…
Add table
Reference in a new issue