mirror of
https://github.com/jarun/nnn.git
synced 2025-01-10 01:49:38 +00:00
Reformat copy current current file name
This commit is contained in:
parent
49be2cfcd1
commit
51829c8027
15
src/nnn.c
15
src/nnn.c
|
@ -810,7 +810,7 @@ static haiku_nm_h haiku_hnd;
|
||||||
#define exitcurses() endwin()
|
#define exitcurses() endwin()
|
||||||
#define printwarn(presel) printwait(strerror(errno), presel)
|
#define printwarn(presel) printwait(strerror(errno), presel)
|
||||||
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
|
#define istopdir(path) ((path)[1] == '\0' && (path)[0] == '/')
|
||||||
#define copycurname() xstrsncpy(lastname, pdents[cur].name, NAME_MAX + 1)
|
#define copycurname() xstrsncpy(lastname, ndents ? pdents[cur].name : "\0", NAME_MAX + 1)
|
||||||
#define settimeout() timeout(1000)
|
#define settimeout() timeout(1000)
|
||||||
#define cleartimeout() timeout(-1)
|
#define cleartimeout() timeout(-1)
|
||||||
#define errexit() printerr(__LINE__)
|
#define errexit() printerr(__LINE__)
|
||||||
|
@ -3434,7 +3434,6 @@ end:
|
||||||
ln[REGEX_MAX - 1] = ln[1];
|
ln[REGEX_MAX - 1] = ln[1];
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
|
|
||||||
curs_set(FALSE);
|
curs_set(FALSE);
|
||||||
|
@ -6669,8 +6668,6 @@ nochange:
|
||||||
|
|
||||||
/* Start watching the directory */
|
/* Start watching the directory */
|
||||||
watch = TRUE;
|
watch = TRUE;
|
||||||
|
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
|
@ -6716,7 +6713,6 @@ nochange:
|
||||||
} else {
|
} else {
|
||||||
if (cfg.filtermode || filterset())
|
if (cfg.filtermode || filterset())
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
}
|
}
|
||||||
|
@ -7058,7 +7054,6 @@ nochange:
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
clearfilter();
|
clearfilter();
|
||||||
}
|
}
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
goto begin;
|
goto begin;
|
||||||
case SEL_DETAIL:
|
case SEL_DETAIL:
|
||||||
|
@ -7146,7 +7141,6 @@ nochange:
|
||||||
g_state.autonext ^= 1;
|
g_state.autonext ^= 1;
|
||||||
if (cfg.filtermode)
|
if (cfg.filtermode)
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
goto nochange;
|
goto nochange;
|
||||||
case SEL_EDIT:
|
case SEL_EDIT:
|
||||||
|
@ -7166,7 +7160,6 @@ nochange:
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
/* Repopulate as directory content may have changed */
|
/* Repopulate as directory content may have changed */
|
||||||
goto begin;
|
goto begin;
|
||||||
|
@ -7332,7 +7325,7 @@ nochange:
|
||||||
|
|
||||||
if (newpath[0] && !access(newpath, F_OK))
|
if (newpath[0] && !access(newpath, F_OK))
|
||||||
xstrsncpy(lastname, xbasename(newpath), NAME_MAX+1);
|
xstrsncpy(lastname, xbasename(newpath), NAME_MAX+1);
|
||||||
else if (ndents)
|
else
|
||||||
copycurname();
|
copycurname();
|
||||||
goto begin;
|
goto begin;
|
||||||
}
|
}
|
||||||
|
@ -7551,7 +7544,6 @@ nochange:
|
||||||
if (g_state.picked)
|
if (g_state.picked)
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
|
|
||||||
if (!r) {
|
if (!r) {
|
||||||
|
@ -7598,7 +7590,6 @@ nochange:
|
||||||
presel = FILTER;
|
presel = FILTER;
|
||||||
|
|
||||||
/* Save current */
|
/* Save current */
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
|
|
||||||
if (!r)
|
if (!r)
|
||||||
|
@ -7715,9 +7706,7 @@ nochange:
|
||||||
idle = 0;
|
idle = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ndents)
|
|
||||||
copycurname();
|
copycurname();
|
||||||
|
|
||||||
goto nochange;
|
goto nochange;
|
||||||
} /* switch (sel) */
|
} /* switch (sel) */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue