mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
Set defaults for some multiple choice prompts
Archive options: listing Create new options: create file Open with options: command type GUI
This commit is contained in:
parent
ad4ecb19cb
commit
b80e047d50
12
src/nnn.c
12
src/nnn.c
|
@ -637,8 +637,8 @@ static const char * const messages[] = {
|
||||||
"'c'urrent/'s'el?",
|
"'c'urrent/'s'el?",
|
||||||
"%s %s? [Esc cancels]",
|
"%s %s? [Esc cancels]",
|
||||||
"size limit exceeded",
|
"size limit exceeded",
|
||||||
"'f'ile/'d'ir/'s'ym/'h'ard?",
|
"['f'ile]/'d'ir/'s'ym/'h'ard?",
|
||||||
"'c'li/'g'ui?",
|
"['g'ui]/'c'li?",
|
||||||
"overwrite?",
|
"overwrite?",
|
||||||
"'s'ave/'l'oad/'r'estore?",
|
"'s'ave/'l'oad/'r'estore?",
|
||||||
"Quit all contexts?",
|
"Quit all contexts?",
|
||||||
|
@ -659,7 +659,7 @@ static const char * const messages[] = {
|
||||||
"'s'shfs/'r'clone?",
|
"'s'shfs/'r'clone?",
|
||||||
"refresh if slow",
|
"refresh if slow",
|
||||||
"app: ",
|
"app: ",
|
||||||
"'o'pen/e'x'tract/'l's/'m'nt?",
|
"['l's]/'o'pen/e'x'tract/'m'nt?",
|
||||||
"keys:",
|
"keys:",
|
||||||
"invalid regex",
|
"invalid regex",
|
||||||
"'a'u/'d'u/'e'xt/'r'ev/'s'z/'t'm/'v'er/'c'lr/'^T'?",
|
"'a'u/'d'u/'e'xt/'r'ev/'s'z/'t'm/'v'er/'c'lr/'^T'?",
|
||||||
|
@ -6096,7 +6096,7 @@ static void handle_openwith(const char *path, const char *name, char *newpath, c
|
||||||
int r = get_input(messages[MSG_CLI_MODE]);
|
int r = get_input(messages[MSG_CLI_MODE]);
|
||||||
|
|
||||||
r = (r == 'c' ? F_CLI :
|
r = (r == 'c' ? F_CLI :
|
||||||
(r == 'g' ? F_NOWAIT | F_NOTRACE | F_MULTI : 0));
|
((r == 'g' || r == '\r') ? (F_NOWAIT | F_NOTRACE | F_MULTI) : 0));
|
||||||
if (r) {
|
if (r) {
|
||||||
mkpath(path, name, newpath);
|
mkpath(path, name, newpath);
|
||||||
spawn(tmp, newpath, NULL, NULL, r);
|
spawn(tmp, newpath, NULL, NULL, r);
|
||||||
|
@ -7078,6 +7078,8 @@ nochange:
|
||||||
if (tmp && !regexec(&archive_re, tmp, 0, NULL, 0)) {
|
if (tmp && !regexec(&archive_re, tmp, 0, NULL, 0)) {
|
||||||
#endif
|
#endif
|
||||||
r = get_input(messages[MSG_ARCHIVE_OPTS]);
|
r = get_input(messages[MSG_ARCHIVE_OPTS]);
|
||||||
|
if (r == '\r')
|
||||||
|
r = 'l';
|
||||||
if (r == 'l' || r == 'x') {
|
if (r == 'l' || r == 'x') {
|
||||||
mkpath(path, pent->name, newpath);
|
mkpath(path, pent->name, newpath);
|
||||||
if (!handle_archive(newpath, r)) {
|
if (!handle_archive(newpath, r)) {
|
||||||
|
@ -7611,6 +7613,8 @@ nochange:
|
||||||
case SEL_NEW:
|
case SEL_NEW:
|
||||||
if (!pkey) {
|
if (!pkey) {
|
||||||
r = get_input(messages[MSG_NEW_OPTS]);
|
r = get_input(messages[MSG_NEW_OPTS]);
|
||||||
|
if (r == '\r')
|
||||||
|
r = 'f';
|
||||||
tmp = NULL;
|
tmp = NULL;
|
||||||
} else {
|
} else {
|
||||||
r = 'f';
|
r = 'f';
|
||||||
|
|
Loading…
Reference in a new issue