This commit is contained in:
Arun Prakash Jana 2020-02-01 22:30:32 +05:30
parent 897f01c2c3
commit da4f585188
No known key found for this signature in database
GPG key ID: A75979F35C080412
2 changed files with 12 additions and 4 deletions

View file

@ -531,7 +531,7 @@ static const char * const messages[] = {
"\nPress Enter to continue", "\nPress Enter to continue",
"open failed", "open failed",
"dir inaccessible", "dir inaccessible",
"empty: use open with", "empty: edit or open with",
"unsupported file", "unsupported file",
"not set", "not set",
"entry exists", "entry exists",
@ -3976,11 +3976,12 @@ static void show_help(const char *path)
"9o ^O Open with...%-12cn Create new/link\n" "9o ^O Open with...%-12cn Create new/link\n"
"9f ^F File details%-12cd Detail view toggle\n" "9f ^F 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%-17c* Toggle exe\n" "cz Archive%-17ce Edit in EDITOR\n"
"5Space ^J (Un)select%-11cm ^K Mark range/clear\n" "5Space ^J (Un)select%-11cm ^K Mark range/clear\n"
"9p ^P Copy sel here%-11ca Select all\n" "9p ^P Copy sel here%-11ca Select all\n"
"9v ^V Move sel here%-8cw ^W Copy/move sel as\n" "9v ^V Move sel here%-8cw ^W Copy/move sel as\n"
"9x ^X Delete%-18ce Edit sel\n" "9x ^X Delete%-18cE Edit sel\n"
"c* Toggle exe%-0c\n"
"1MISC\n" "1MISC\n"
"9; ^S Select plugin%-11c= Launch app\n" "9; ^S Select plugin%-11c= Launch app\n"
"9! ^] Shell%-19c] Cmd prompt\n" "9! ^] Shell%-19c] Cmd prompt\n"
@ -5461,6 +5462,7 @@ 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_EDIT: // fallthrough
case SEL_LOCK: case SEL_LOCK:
{ {
bool refresh = FALSE; bool refresh = FALSE;
@ -5486,6 +5488,9 @@ nochange:
if (cfg.filtermode) if (cfg.filtermode)
presel = FILTER; presel = FILTER;
continue; continue;
case SEL_EDIT:
spawn(editor, dents[cur].name, NULL, path, F_CLI);
continue;
default: /* SEL_LOCK */ default: /* SEL_LOCK */
lock_terminal(); lock_terminal();
break; break;

View file

@ -84,6 +84,7 @@ enum action {
SEL_REMOTE, SEL_REMOTE,
SEL_UMOUNT, SEL_UMOUNT,
SEL_HELP, SEL_HELP,
SEL_EDIT,
SEL_PLUGIN, SEL_PLUGIN,
SEL_SHELL, SEL_SHELL,
SEL_LAUNCH, SEL_LAUNCH,
@ -190,7 +191,7 @@ static struct key bindings[] = {
/* Select all files in current dir */ /* Select all files in current dir */
{ 'a', SEL_SELALL }, { 'a', SEL_SELALL },
/* List, edit selection */ /* List, edit selection */
{ 'e', SEL_SELEDIT }, { 'E', SEL_SELEDIT },
/* Copy from selection buffer */ /* Copy from selection buffer */
{ 'p', SEL_CP }, { 'p', SEL_CP },
{ CONTROL('P'), SEL_CP }, { CONTROL('P'), SEL_CP },
@ -218,6 +219,8 @@ static struct key bindings[] = {
{ 'u', SEL_UMOUNT }, { 'u', SEL_UMOUNT },
/* Show help */ /* Show help */
{ '?', SEL_HELP }, { '?', SEL_HELP },
/* Edit in EDITOR */
{ 'e', SEL_EDIT },
/* Run a plugin */ /* Run a plugin */
{ ';', SEL_PLUGIN }, { ';', SEL_PLUGIN },
{ CONTROL('S'), SEL_PLUGIN }, { CONTROL('S'), SEL_PLUGIN },