mirror of
https://github.com/jarun/nnn.git
synced 2025-01-15 13:26:37 +00:00
fix breaking patches
This commit is contained in:
parent
744e9aaf70
commit
0df6eebea0
|
@ -6,7 +6,7 @@
|
||||||
# Authors: Luuk van Baal
|
# Authors: Luuk van Baal
|
||||||
|
|
||||||
diff --git a/src/nnn.c b/src/nnn.c
|
diff --git a/src/nnn.c b/src/nnn.c
|
||||||
index 508ee915..77d56d63 100644
|
index f8a2c58..157cea5 100644
|
||||||
--- a/src/nnn.c
|
--- a/src/nnn.c
|
||||||
+++ b/src/nnn.c
|
+++ b/src/nnn.c
|
||||||
@@ -265,6 +265,25 @@
|
@@ -265,6 +265,25 @@
|
||||||
|
@ -43,7 +43,7 @@ index 508ee915..77d56d63 100644
|
||||||
} *pEntry;
|
} *pEntry;
|
||||||
|
|
||||||
/* Selection marker */
|
/* Selection marker */
|
||||||
@@ -345,6 +365,7 @@ typedef struct {
|
@@ -344,6 +364,7 @@ typedef struct {
|
||||||
uint_t cliopener : 1; /* All-CLI app opener */
|
uint_t cliopener : 1; /* All-CLI app opener */
|
||||||
uint_t waitedit : 1; /* For ops that can't be detached, used EDITOR */
|
uint_t waitedit : 1; /* For ops that can't be detached, used EDITOR */
|
||||||
uint_t rollover : 1; /* Roll over at edges */
|
uint_t rollover : 1; /* Roll over at edges */
|
||||||
|
@ -69,15 +69,7 @@ index 508ee915..77d56d63 100644
|
||||||
|
|
||||||
/* Configuration, contexts */
|
/* Configuration, contexts */
|
||||||
static settings cfg = {
|
static settings cfg = {
|
||||||
@@ -425,6 +456,7 @@ static settings cfg = {
|
@@ -3819,6 +3850,56 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
|
||||||
0, /* cliopener */
|
|
||||||
0, /* waitedit */
|
|
||||||
1, /* rollover */
|
|
||||||
+ 0, /* normalgit */
|
|
||||||
};
|
|
||||||
|
|
||||||
static context g_ctx[CTX_MAX] __attribute__ ((aligned));
|
|
||||||
@@ -3838,6 +3870,56 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -134,7 +126,7 @@ index 508ee915..77d56d63 100644
|
||||||
static void resetdircolor(int flags)
|
static void resetdircolor(int flags)
|
||||||
{
|
{
|
||||||
/* Directories are always shown on top, clear the color when moving to first file */
|
/* Directories are always shown on top, clear the color when moving to first file */
|
||||||
@@ -4182,6 +4264,10 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
@@ -4163,6 +4244,10 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
||||||
|
|
||||||
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
|
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
|
||||||
|
|
||||||
|
@ -145,7 +137,7 @@ index 508ee915..77d56d63 100644
|
||||||
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
|
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
|
||||||
|
|
||||||
if (g_state.oldcolor)
|
if (g_state.oldcolor)
|
||||||
@@ -5630,6 +5716,11 @@ static int dentfill(char *path, struct entry **ppdents)
|
@@ -5629,6 +5714,11 @@ static int dentfill(char *path, struct entry **ppdents)
|
||||||
attron(COLOR_PAIR(cfg.curctx + 1));
|
attron(COLOR_PAIR(cfg.curctx + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,7 +149,7 @@ index 508ee915..77d56d63 100644
|
||||||
#if _POSIX_C_SOURCE >= 200112L
|
#if _POSIX_C_SOURCE >= 200112L
|
||||||
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
|
posix_fadvise(fd, 0, 0, POSIX_FADV_SEQUENTIAL);
|
||||||
#endif
|
#endif
|
||||||
@@ -5830,6 +5921,29 @@ static int dentfill(char *path, struct entry **ppdents)
|
@@ -5829,6 +5919,29 @@ static int dentfill(char *path, struct entry **ppdents)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -187,7 +179,7 @@ index 508ee915..77d56d63 100644
|
||||||
++ndents;
|
++ndents;
|
||||||
} while ((dp = readdir(dirp)));
|
} while ((dp = readdir(dirp)));
|
||||||
|
|
||||||
@@ -6373,11 +6487,12 @@ static int adjust_cols(int n)
|
@@ -6372,11 +6485,12 @@ static int adjust_cols(int n)
|
||||||
#endif
|
#endif
|
||||||
if (cfg.showdetail) {
|
if (cfg.showdetail) {
|
||||||
/* Fallback to light mode if less than 35 columns */
|
/* Fallback to light mode if less than 35 columns */
|
||||||
|
@ -203,7 +195,7 @@ index 508ee915..77d56d63 100644
|
||||||
|
|
||||||
/* 2 columns for preceding space and indicator */
|
/* 2 columns for preceding space and indicator */
|
||||||
return (n - 2);
|
return (n - 2);
|
||||||
@@ -8144,6 +8259,7 @@ static void usage(void)
|
@@ -8148,6 +8262,7 @@ static void usage(void)
|
||||||
" -F val fifo mode [0:preview 1:explore]\n"
|
" -F val fifo mode [0:preview 1:explore]\n"
|
||||||
#endif
|
#endif
|
||||||
" -g regex filters\n"
|
" -g regex filters\n"
|
||||||
|
@ -211,7 +203,7 @@ index 508ee915..77d56d63 100644
|
||||||
" -H show hidden files\n"
|
" -H show hidden files\n"
|
||||||
" -i show current file info\n"
|
" -i show current file info\n"
|
||||||
" -J no auto-advance on selection\n"
|
" -J no auto-advance on selection\n"
|
||||||
@@ -8282,6 +8398,7 @@ static void cleanup(void)
|
@@ -8286,6 +8401,7 @@ static void cleanup(void)
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -219,7 +211,7 @@ index 508ee915..77d56d63 100644
|
||||||
free(selpath);
|
free(selpath);
|
||||||
free(plgpath);
|
free(plgpath);
|
||||||
free(cfgpath);
|
free(cfgpath);
|
||||||
@@ -8326,7 +8443,7 @@ int main(int argc, char *argv[])
|
@@ -8330,7 +8446,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
while ((opt = (env_opts_id > 0
|
while ((opt = (env_opts_id > 0
|
||||||
? env_opts[--env_opts_id]
|
? env_opts[--env_opts_id]
|
||||||
|
@ -228,7 +220,7 @@ index 508ee915..77d56d63 100644
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
#ifndef NOFIFO
|
#ifndef NOFIFO
|
||||||
case 'a':
|
case 'a':
|
||||||
@@ -8377,6 +8494,9 @@ int main(int argc, char *argv[])
|
@@ -8381,6 +8497,9 @@ int main(int argc, char *argv[])
|
||||||
cfg.regex = 1;
|
cfg.regex = 1;
|
||||||
filterfn = &visible_re;
|
filterfn = &visible_re;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -70,14 +70,6 @@ index ee1f5beb..91aab231 100644
|
||||||
|
|
||||||
/* Configuration, contexts */
|
/* Configuration, contexts */
|
||||||
static settings cfg = {
|
static settings cfg = {
|
||||||
@@ -429,6 +460,7 @@ static settings cfg = {
|
|
||||||
0, /* cliopener */
|
|
||||||
0, /* waitedit */
|
|
||||||
1, /* rollover */
|
|
||||||
+ 0, /* normalgit */
|
|
||||||
};
|
|
||||||
|
|
||||||
static context g_ctx[CTX_MAX] __attribute__ ((aligned));
|
|
||||||
@@ -3846,6 +3878,56 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
|
@@ -3846,6 +3878,56 @@ static int get_kv_key(kv *kvarr, char *val, uchar_t max, uchar_t id)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
# Author: Luuk van Baal
|
# Author: Luuk van Baal
|
||||||
|
|
||||||
diff --git a/src/nnn.c b/src/nnn.c
|
diff --git a/src/nnn.c b/src/nnn.c
|
||||||
index 508ee915..ee1f5beb 100644
|
index f8a2c58..9802a1f 100644
|
||||||
--- a/src/nnn.c
|
--- a/src/nnn.c
|
||||||
+++ b/src/nnn.c
|
+++ b/src/nnn.c
|
||||||
@@ -394,6 +394,10 @@ typedef struct {
|
@@ -394,6 +394,10 @@ typedef struct {
|
||||||
|
@ -18,7 +18,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
/* GLOBALS */
|
/* GLOBALS */
|
||||||
|
|
||||||
/* Configuration, contexts */
|
/* Configuration, contexts */
|
||||||
@@ -1091,10 +1095,12 @@ static char *getpwname(uid_t uid)
|
@@ -1070,10 +1074,12 @@ static char *getpwname(uid_t uid)
|
||||||
static char *namecache;
|
static char *namecache;
|
||||||
|
|
||||||
if (uidcache != uid) {
|
if (uidcache != uid) {
|
||||||
|
@ -31,7 +31,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
return namecache ? namecache : xitoa(uid);
|
return namecache ? namecache : xitoa(uid);
|
||||||
@@ -1106,10 +1112,12 @@ static char *getgrname(gid_t gid)
|
@@ -1085,10 +1091,12 @@ static char *getgrname(gid_t gid)
|
||||||
static char *grpcache;
|
static char *grpcache;
|
||||||
|
|
||||||
if (gidcache != gid) {
|
if (gidcache != gid) {
|
||||||
|
@ -44,7 +44,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
return grpcache ? grpcache : xitoa(gid);
|
return grpcache ? grpcache : xitoa(gid);
|
||||||
@@ -3853,14 +3861,13 @@ static void resetdircolor(int flags)
|
@@ -3834,14 +3842,13 @@ static void resetdircolor(int flags)
|
||||||
* Max supported str length: NAME_MAX;
|
* Max supported str length: NAME_MAX;
|
||||||
*/
|
*/
|
||||||
#ifdef NOLC
|
#ifdef NOLC
|
||||||
|
@ -62,7 +62,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
{
|
{
|
||||||
wchar_t * const wbuf = (wchar_t *)g_buf;
|
wchar_t * const wbuf = (wchar_t *)g_buf;
|
||||||
wchar_t *buf = wbuf;
|
wchar_t *buf = wbuf;
|
||||||
@@ -3885,7 +3892,7 @@ static wchar_t *unescape(const char *str, uint_t maxcols)
|
@@ -3866,7 +3873,7 @@ static wchar_t *unescape(const char *str, uint_t maxcols)
|
||||||
++buf;
|
++buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
static off_t get_size(off_t size, off_t *pval, int comp)
|
static off_t get_size(off_t size, off_t *pval, int comp)
|
||||||
@@ -4153,33 +4160,7 @@ static uchar_t get_color_pair_name_ind(const struct entry *ent, char *pind, int
|
@@ -4134,33 +4141,7 @@ static uchar_t get_color_pair_name_ind(const struct entry *ent, char *pind, int
|
||||||
static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
||||||
{
|
{
|
||||||
char ind = '\0';
|
char ind = '\0';
|
||||||
|
@ -106,7 +106,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
|
uchar_t color_pair = get_color_pair_name_ind(ent, &ind, &attrs);
|
||||||
|
|
||||||
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
|
addch((ent->flags & FILE_SELECTED) ? '+' | A_REVERSE | A_BOLD : ' ');
|
||||||
@@ -4204,15 +4185,40 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
@@ -4185,15 +4166,40 @@ static void printent(const struct entry *ent, uint_t namecols, bool sel)
|
||||||
++namecols;
|
++namecols;
|
||||||
|
|
||||||
#ifndef NOLC
|
#ifndef NOLC
|
||||||
|
@ -150,7 +150,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
static void savecurctx(char *path, char *curname, int nextctx)
|
static void savecurctx(char *path, char *curname, int nextctx)
|
||||||
@@ -6357,14 +6363,6 @@ static void statusbar(char *path)
|
@@ -6356,26 +6362,19 @@ static void statusbar(char *path)
|
||||||
tocursor();
|
tocursor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -165,11 +165,12 @@ index 508ee915..ee1f5beb 100644
|
||||||
static int adjust_cols(int n)
|
static int adjust_cols(int n)
|
||||||
{
|
{
|
||||||
/* Calculate the number of cols available to print entry name */
|
/* Calculate the number of cols available to print entry name */
|
||||||
@@ -6372,11 +6370,10 @@ static int adjust_cols(int n)
|
#ifdef ICONS_ENABLED
|
||||||
n -= (g_state.oldcolor ? 0 : 1 + ICON_PADDING_LEFT_LEN + ICON_PADDING_RIGHT_LEN);
|
n -= (g_state.oldcolor ? 0 : ICON_SIZE + ICON_PADDING_LEFT_LEN + ICON_PADDING_RIGHT_LEN);
|
||||||
#endif
|
#endif
|
||||||
|
+
|
||||||
if (cfg.showdetail) {
|
if (cfg.showdetail) {
|
||||||
- /* Fallback to light mode if less than 35 columns */
|
/* Fallback to light mode if less than 35 columns */
|
||||||
- if (n < 36)
|
- if (n < 36)
|
||||||
+ if (n < (dtls.maxentln + 1 - dtls.maxnameln))
|
+ if (n < (dtls.maxentln + 1 - dtls.maxnameln))
|
||||||
cfg.showdetail ^= 1;
|
cfg.showdetail ^= 1;
|
||||||
|
@ -179,7 +180,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 2 columns for preceding space and indicator */
|
/* 2 columns for preceding space and indicator */
|
||||||
@@ -6413,8 +6410,6 @@ static void draw_line(int ncols)
|
@@ -6412,8 +6411,6 @@ static void draw_line(int ncols)
|
||||||
/* Must reset e.g. no files in dir */
|
/* Must reset e.g. no files in dir */
|
||||||
if (dir)
|
if (dir)
|
||||||
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
|
attroff(COLOR_PAIR(cfg.curctx + 1) | A_BOLD);
|
||||||
|
@ -188,7 +189,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
}
|
}
|
||||||
|
|
||||||
static void redraw(char *path)
|
static void redraw(char *path)
|
||||||
@@ -6522,6 +6517,21 @@ static void redraw(char *path)
|
@@ -6521,6 +6518,21 @@ static void redraw(char *path)
|
||||||
|
|
||||||
onscreen = MIN(onscreen + curscroll, ndents);
|
onscreen = MIN(onscreen + curscroll, ndents);
|
||||||
|
|
||||||
|
@ -210,7 +211,7 @@ index 508ee915..ee1f5beb 100644
|
||||||
ncols = adjust_cols(ncols);
|
ncols = adjust_cols(ncols);
|
||||||
|
|
||||||
int len = scanselforpath(path, FALSE);
|
int len = scanselforpath(path, FALSE);
|
||||||
@@ -6552,7 +6562,7 @@ static void redraw(char *path)
|
@@ -6551,7 +6563,7 @@ static void redraw(char *path)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue