Remove p and e

This commit is contained in:
Arun Prakash Jana 2020-01-14 02:26:32 +05:30
parent d65271860a
commit 5bc20f1460
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 11 additions and 27 deletions

View file

@ -501,7 +501,7 @@ static const char * const messages[] = {
"\nPress Enter to continue", "\nPress Enter to continue",
"open failed", "open failed",
"dir inaccessible", "dir inaccessible",
"empty: edit or open with", "empty: use open with",
"unsupported file", "unsupported file",
"not set", "not set",
"dir changed, range sel off", "dir changed, range sel off",
@ -3620,7 +3620,6 @@ static void show_help(const char *path)
"cD File details%-12cd Detail view toggle\n" "cD File details%-12cd Detail view toggle\n"
"b^R Rename/dup%-14cr Batch rename\n" "b^R Rename/dup%-14cr Batch rename\n"
"cz Archive entry%-11c* Toggle exe\n" "cz Archive entry%-11c* Toggle exe\n"
"ce Edit in EDITOR%-10cp Open in PAGER\n"
"5Space ^J (Un)select%-11cm ^K Mark range/clear\n" "5Space ^J (Un)select%-11cm ^K Mark range/clear\n"
"cP Copy sel here%-11ca Select all\n" "cP Copy sel here%-11ca Select all\n"
"cV Move sel here%-10c^V Copy/move sel as\n" "cV Move sel here%-10c^V Copy/move sel as\n"
@ -4745,25 +4744,25 @@ nochange:
} }
} }
if (!sb.st_size) {
printwait(messages[MSG_EMPTY_FILE], &presel);
goto nochange;
}
/* If NNN_USE_EDITOR is set, open text in EDITOR */ /* If NNN_USE_EDITOR is set, open text in EDITOR */
if (cfg.useeditor && if (cfg.useeditor && (!sb.st_size ||
#ifdef FILE_MIME_OPTS #ifdef FILE_MIME_OPTS
get_output(g_buf, CMD_LEN_MAX, "file", FILE_MIME_OPTS, newpath, FALSE) (get_output(g_buf, CMD_LEN_MAX, "file", FILE_MIME_OPTS, newpath, FALSE)
&& !strncmp(g_buf, "text/", 5)) { && !strncmp(g_buf, "text/", 5)))) {
#else #else
/* no mime option; guess from description instead */ /* no mime option; guess from description instead */
get_output(g_buf, CMD_LEN_MAX, "file", "-b", newpath, FALSE) (get_output(g_buf, CMD_LEN_MAX, "file", "-b", newpath, FALSE)
&& strstr(g_buf, "text")) { && strstr(g_buf, "text")))) {
#endif #endif
spawn(editor, newpath, NULL, path, F_CLI); spawn(editor, newpath, NULL, path, F_CLI);
continue; continue;
} }
if (!sb.st_size) {
printwait(messages[MSG_EMPTY_FILE], &presel);
goto nochange;
}
if (!regexec(&archive_re, dents[cur].name, 0, NULL, 0)) { if (!regexec(&archive_re, dents[cur].name, 0, NULL, 0)) {
r = get_input(messages[MSG_ARCHIVE_OPTS]); r = get_input(messages[MSG_ARCHIVE_OPTS]);
if (r == 'l' || r == 'x') { if (r == 'l' || r == 'x') {
@ -5086,16 +5085,12 @@ nochange:
case SEL_REDRAW: // fallthrough case SEL_REDRAW: // fallthrough
case SEL_RENAMEMUL: // fallthrough case SEL_RENAMEMUL: // fallthrough
case SEL_HELP: // fallthrough case SEL_HELP: // fallthrough
case SEL_RUNEDIT: // fallthrough
case SEL_RUNPAGE: // fallthrough
case SEL_LOCK: case SEL_LOCK:
{ {
bool refresh = FALSE; bool refresh = FALSE;
if (ndents) if (ndents)
mkpath(path, dents[cur].name, newpath); mkpath(path, dents[cur].name, newpath);
else if (sel == SEL_RUNEDIT || sel == SEL_RUNPAGE)
break;
switch (sel) { switch (sel) {
case SEL_REDRAW: case SEL_REDRAW:
@ -5115,12 +5110,6 @@ nochange:
if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
continue; continue;
case SEL_RUNEDIT:
spawn(editor, dents[cur].name, NULL, path, F_CLI);
continue;
case SEL_RUNPAGE:
spawn(pager, dents[cur].name, NULL, path, F_CLI);
continue;
default: /* SEL_LOCK */ default: /* SEL_LOCK */
lock_terminal(); lock_terminal();
break; break;

View file

@ -89,8 +89,6 @@ enum action {
SEL_SHELL, SEL_SHELL,
SEL_LAUNCH, SEL_LAUNCH,
SEL_RUNCMD, SEL_RUNCMD,
SEL_RUNEDIT,
SEL_RUNPAGE,
SEL_LOCK, SEL_LOCK,
SEL_SESSIONS, SEL_SESSIONS,
SEL_QUITCTX, SEL_QUITCTX,
@ -224,9 +222,6 @@ static struct key bindings[] = {
{ '=', SEL_LAUNCH }, { '=', SEL_LAUNCH },
/* Run a command */ /* Run a command */
{ ']', SEL_RUNCMD }, { ']', SEL_RUNCMD },
/* Open in EDITOR or PAGER */
{ 'e', SEL_RUNEDIT },
{ 'p', SEL_RUNPAGE },
/* Lock screen */ /* Lock screen */
{ 'L', SEL_LOCK }, { 'L', SEL_LOCK },
/* Quit a context */ /* Quit a context */