mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 21:36:42 +00:00
File list mode changes
- support listing maximum 16K files - check if target directory exists before directory tree creation in most of the cases many files will be under the same directory - make frequently used function 'inline'
This commit is contained in:
parent
f530b2ca18
commit
21eebbb003
2
nnn.1
2
nnn.1
|
@ -312,7 +312,7 @@ There are two ways to search and list:
|
||||||
.Pp
|
.Pp
|
||||||
File paths must be NUL-separated ('\\0'). Paths and can be relative to the
|
File paths must be NUL-separated ('\\0'). Paths and can be relative to the
|
||||||
current directory or absolute. Invalid paths in the input are ignored. Input
|
current directory or absolute. Invalid paths in the input are ignored. Input
|
||||||
limit is 65,536 paths or 256 MiB of data.
|
limit is 16,384 paths or 256 MiB of data.
|
||||||
.Pp
|
.Pp
|
||||||
To list the input stream, start
|
To list the input stream, start
|
||||||
.Nm
|
.Nm
|
||||||
|
|
10
src/nnn.c
10
src/nnn.c
|
@ -189,7 +189,7 @@
|
||||||
#define DOT_FILTER_LEN 7
|
#define DOT_FILTER_LEN 7
|
||||||
#define ASCII_MAX 128
|
#define ASCII_MAX 128
|
||||||
#define EXEC_ARGS_MAX 10
|
#define EXEC_ARGS_MAX 10
|
||||||
#define LIST_FILES_MAX (1 << 16)
|
#define LIST_FILES_MAX (1 << 14) /* Support listing 16K files */
|
||||||
#define SCROLLOFF 3
|
#define SCROLLOFF 3
|
||||||
#define COLOR_256 256
|
#define COLOR_256 256
|
||||||
|
|
||||||
|
@ -5543,7 +5543,7 @@ static bool prep_threads(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Skip self and parent */
|
/* Skip self and parent */
|
||||||
static bool selforparent(const char *path)
|
static inline bool selforparent(const char *path)
|
||||||
{
|
{
|
||||||
return path[0] == '.' && (path[1] == '\0' || (path[1] == '.' && path[2] == '\0'));
|
return path[0] == '.' && (path[1] == '\0' || (path[1] == '.' && path[2] == '\0'));
|
||||||
}
|
}
|
||||||
|
@ -7900,7 +7900,8 @@ static char *make_tmp_tree(char **paths, ssize_t entries, const char *prefix)
|
||||||
if (slash)
|
if (slash)
|
||||||
*slash = '\0';
|
*slash = '\0';
|
||||||
|
|
||||||
xmktree(tmpdir, TRUE);
|
if (access(tmpdir, F_OK)) /* Create directory if it doesn't exist */
|
||||||
|
xmktree(tmpdir, TRUE);
|
||||||
|
|
||||||
if (slash)
|
if (slash)
|
||||||
*slash = '/';
|
*slash = '/';
|
||||||
|
@ -8194,7 +8195,8 @@ static bool setup_config(void)
|
||||||
/* Create bookmarks, sessions, mounts and plugins directories */
|
/* Create bookmarks, sessions, mounts and plugins directories */
|
||||||
for (r = 0; r < ELEMENTS(toks); ++r) {
|
for (r = 0; r < ELEMENTS(toks); ++r) {
|
||||||
mkpath(cfgpath, toks[r], plgpath);
|
mkpath(cfgpath, toks[r], plgpath);
|
||||||
if (!xmktree(plgpath, TRUE)) {
|
/* The dirs are created on first run, check if they already exist */
|
||||||
|
if (access(plgpath, F_OK) && !xmktree(plgpath, TRUE)) {
|
||||||
DPRINTF_S(toks[r]);
|
DPRINTF_S(toks[r]);
|
||||||
xerror();
|
xerror();
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
Loading…
Reference in a new issue