mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 09:59:56 +00:00
Delay for copy messages
This commit is contained in:
parent
a70a4bf732
commit
df5daf409e
21
src/nnn.c
21
src/nnn.c
|
@ -232,7 +232,7 @@ disabledbg()
|
||||||
#define printwarn() printmsg(strerror(errno))
|
#define printwarn() printmsg(strerror(errno))
|
||||||
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
|
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
|
||||||
#define copycurname() xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
|
#define copycurname() xstrlcpy(lastname, dents[cur].name, NAME_MAX + 1)
|
||||||
#define settimeout() timeout(500)
|
#define settimeout() timeout(1000)
|
||||||
#define cleartimeout() timeout(-1)
|
#define cleartimeout() timeout(-1)
|
||||||
#define errexit() printerr(__LINE__)
|
#define errexit() printerr(__LINE__)
|
||||||
#define setdirwatch() (cfg.filtermode ? (presel = FILTER) : (dir_changed = TRUE))
|
#define setdirwatch() (cfg.filtermode ? (presel = FILTER) : (dir_changed = TRUE))
|
||||||
|
@ -581,7 +581,6 @@ static inline void printmsg(const char *msg)
|
||||||
static void printwait(const char *msg, int *presel)
|
static void printwait(const char *msg, int *presel)
|
||||||
{
|
{
|
||||||
printmsg(msg);
|
printmsg(msg);
|
||||||
if (presel)
|
|
||||||
*presel = MSGWAIT;
|
*presel = MSGWAIT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -615,6 +614,12 @@ static int get_input(const char *prompt)
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void xdelay(void)
|
||||||
|
{
|
||||||
|
refresh();
|
||||||
|
usleep(350000); /* 350 ms delay */
|
||||||
|
}
|
||||||
|
|
||||||
static char confirm_force(void)
|
static char confirm_force(void)
|
||||||
{
|
{
|
||||||
int r = get_input("use force? [y/Y]");
|
int r = get_input("use force? [y/Y]");
|
||||||
|
@ -3478,7 +3483,7 @@ nochange:
|
||||||
copystartid = cur;
|
copystartid = cur;
|
||||||
ncp = 0;
|
ncp = 0;
|
||||||
mvprintw(xlines - 1, 0, "selection on");
|
mvprintw(xlines - 1, 0, "selection on");
|
||||||
getch();
|
xdelay();
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3516,8 +3521,8 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
ncp = copyendid - copystartid + 1;
|
ncp = copyendid - copystartid + 1;
|
||||||
mvprintw(xlines - 1, 0, "%d files selected\n", ncp);
|
mvprintw(xlines - 1, 0, "%d selected\n", ncp);
|
||||||
getch();
|
xdelay();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (copybufpos) { /* File path(s) written to the buffer */
|
if (copybufpos) { /* File path(s) written to the buffer */
|
||||||
|
@ -3526,8 +3531,8 @@ nochange:
|
||||||
spawn(copier, NULL, NULL, NULL, F_NOTRACE);
|
spawn(copier, NULL, NULL, NULL, F_NOTRACE);
|
||||||
|
|
||||||
if (ncp) { /* Some files cherry picked */
|
if (ncp) { /* Some files cherry picked */
|
||||||
mvprintw(xlines - 1, 0, "%d files selected\n", ncp);
|
mvprintw(xlines - 1, 0, "%d selected\n", ncp);
|
||||||
getch();
|
xdelay();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printwait("selection off", &presel);
|
printwait("selection off", &presel);
|
||||||
|
@ -3935,7 +3940,7 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Locker */
|
/* Locker */
|
||||||
if (idletimeout != 0 && idle == idletimeout) {
|
if (idletimeout && idle == idletimeout) {
|
||||||
idle = 0;
|
idle = 0;
|
||||||
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL);
|
spawn(utils[LOCKER], NULL, NULL, NULL, F_NORMAL);
|
||||||
goto begin;
|
goto begin;
|
||||||
|
|
Loading…
Reference in a new issue