Show notifier only for associations

This commit is contained in:
Arun Prakash Jana 2017-04-04 19:57:44 +05:30
parent cb1a1112a8
commit 2e3502ea4b
No known key found for this signature in database
GPG key ID: A75979F35C080412
3 changed files with 14 additions and 9 deletions

View file

@ -2,6 +2,8 @@
Noice is Not Noice, a noicer fork... Noice is Not Noice, a noicer fork...
[![nnn_demo.gif](http://s23.postimg.org/fjmcngsux/nnn_demo.gif)](http://postimg.org/image/6olicy42f/)
### Table of Contents ### Table of Contents
- [Introduction](#introduction) - [Introduction](#introduction)
@ -143,7 +145,9 @@ Start nnn (default: current directory):
Filters support regexes to display only the matched entries in the current directory view. This effectively allows searching through the directory tree for a particular entry. Filters support regexes to display only the matched entries in the current directory view. This effectively allows searching through the directory tree for a particular entry.
Filters do not stack on top of each other. They are applied anew every time. An empty filter expression resets the filter. Filters do not stack on top of each other. They are applied anew every time.
An empty filter expression resets the filter.
If nnn is invoked as root the default filter will also match hidden files. If nnn is invoked as root the default filter will also match hidden files.

2
nnn.1
View file

@ -105,7 +105,7 @@ searching through the directory tree for a particular entry.
Filters do not stack on top of each other. They are applied anew Filters do not stack on top of each other. They are applied anew
every time. every time.
.Pp .Pp
To reset the filter you can input an empty filter expression. An empty filter expression resets the filter.
.Pp .Pp
If If
.Nm .Nm

13
nnn.c
View file

@ -274,7 +274,7 @@ xdirname(const char *path)
} }
static void static void
spawn(char *file, char *arg, char *dir) spawn(char *file, char *arg, char *dir, int notify)
{ {
pid_t pid; pid_t pid;
int status; int status;
@ -283,6 +283,7 @@ spawn(char *file, char *arg, char *dir)
if (pid == 0) { if (pid == 0) {
if (dir != NULL) if (dir != NULL)
status = chdir(dir); status = chdir(dir);
if (notify)
fprintf(stdout, "\n +-++-++-+\n | n n n |\n +-++-++-+\n\n"); fprintf(stdout, "\n +-++-++-+\n | n n n |\n +-++-++-+\n\n");
execlp(file, file, arg, NULL); execlp(file, file, arg, NULL);
_exit(1); _exit(1);
@ -1186,7 +1187,7 @@ nochange:
} }
} }
exitcurses(); exitcurses();
spawn(bin, newpath, NULL); spawn(bin, newpath, NULL, 1);
initcurses(); initcurses();
continue; continue;
} }
@ -1328,7 +1329,7 @@ nochange:
else else
snprintf(abspath, PATH_MAX, "%s/%s", snprintf(abspath, PATH_MAX, "%s/%s",
path, dents[cur].name); path, dents[cur].name);
spawn(copier, abspath, NULL); spawn(copier, abspath, NULL, 0);
printmsg(abspath); printmsg(abspath);
} else if (!copier) } else if (!copier)
printmsg("NNN_COPIER is not set"); printmsg("NNN_COPIER is not set");
@ -1342,14 +1343,14 @@ nochange:
case SEL_RUN: case SEL_RUN:
run = xgetenv(env, run); run = xgetenv(env, run);
exitcurses(); exitcurses();
spawn(run, NULL, path); spawn(run, NULL, path, 0);
initcurses(); initcurses();
/* Re-populate as directory content may have changed */ /* Re-populate as directory content may have changed */
goto begin; goto begin;
case SEL_RUNARG: case SEL_RUNARG:
run = xgetenv(env, run); run = xgetenv(env, run);
exitcurses(); exitcurses();
spawn(run, dents[cur].name, path); spawn(run, dents[cur].name, path, 0);
initcurses(); initcurses();
break; break;
} }
@ -1357,7 +1358,7 @@ nochange:
if (idletimeout != 0 && idle == idletimeout) { if (idletimeout != 0 && idle == idletimeout) {
idle = 0; idle = 0;
exitcurses(); exitcurses();
spawn(idlecmd, NULL, NULL); spawn(idlecmd, NULL, NULL, 0);
initcurses(); initcurses();
} }
} }