mirror of
https://github.com/jarun/nnn.git
synced 2025-02-26 03:01:32 +00:00
Combine more cases
This commit is contained in:
parent
bdea298bb5
commit
2c2f1e5eae
1 changed files with 16 additions and 10 deletions
26
src/nnn.c
26
src/nnn.c
|
@ -2929,7 +2929,10 @@ nochange:
|
||||||
case SEL_LIST: // fallthrough
|
case SEL_LIST: // fallthrough
|
||||||
case SEL_EXTRACT: // fallthrough
|
case SEL_EXTRACT: // fallthrough
|
||||||
case SEL_MEDIA: // fallthrough
|
case SEL_MEDIA: // fallthrough
|
||||||
case SEL_FMEDIA:
|
case SEL_FMEDIA: // fallthrough
|
||||||
|
case SEL_RUNEDIT: // fallthrough
|
||||||
|
case SEL_RUNPAGE: // fallthrough
|
||||||
|
case SEL_LOCK:
|
||||||
{
|
{
|
||||||
if (!ndents)
|
if (!ndents)
|
||||||
break;
|
break;
|
||||||
|
@ -2949,6 +2952,18 @@ nochange:
|
||||||
case SEL_EXTRACT:
|
case SEL_EXTRACT:
|
||||||
r = handle_archive(newpath, "-x", path);
|
r = handle_archive(newpath, "-x", path);
|
||||||
break;
|
break;
|
||||||
|
case SEL_RUNEDIT:
|
||||||
|
r = 0;
|
||||||
|
spawn(editor, editor_arg, dents[cur].name, path, F_NORMAL);
|
||||||
|
break;
|
||||||
|
case SEL_RUNPAGE:
|
||||||
|
r = 0;
|
||||||
|
spawn(pager, pager_arg, dents[cur].name, path, F_NORMAL);
|
||||||
|
break;
|
||||||
|
case SEL_LOCK:
|
||||||
|
r = 0;
|
||||||
|
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL | F_SIGINT);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
r = 0;
|
r = 0;
|
||||||
break;
|
break;
|
||||||
|
@ -3408,15 +3423,6 @@ nochange:
|
||||||
|
|
||||||
/* Repopulate as directory content may have changed */
|
/* Repopulate as directory content may have changed */
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_RUNEDIT:
|
|
||||||
spawn(editor, editor_arg, dents[cur].name, path, F_NORMAL);
|
|
||||||
break;
|
|
||||||
case SEL_RUNPAGE:
|
|
||||||
spawn(pager, pager_arg, dents[cur].name, path, F_NORMAL);
|
|
||||||
break;
|
|
||||||
case SEL_LOCK:
|
|
||||||
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL | F_SIGINT);
|
|
||||||
break;
|
|
||||||
case SEL_QUITCD: // fallthrough
|
case SEL_QUITCD: // fallthrough
|
||||||
case SEL_QUIT:
|
case SEL_QUIT:
|
||||||
for (r = 0; r < CTX_MAX; ++r)
|
for (r = 0; r < CTX_MAX; ++r)
|
||||||
|
|
Loading…
Add table
Reference in a new issue