aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2019-05-31 13:26:23 -0700
committerBruce Hill <bruce@bruce-hill.com>2019-05-31 13:26:23 -0700
commit961ac49f81eb9f4de7acb1adfd8836b07857fe2c (patch)
treefbc7da06548dda8dfe3e45dd5a41323b6c397c91
parent17ce3f08df89700cdd83ae993f839eb9ad43dbe7 (diff)
Simplifying interleave code and adding doc
-rw-r--r--bb.c7
-rw-r--r--config.def.h1
2 files changed, 4 insertions, 4 deletions
diff --git a/bb.c b/bb.c
index 8e19d95..d503bae 100644
--- a/bb.c
+++ b/bb.c
@@ -569,14 +569,13 @@ int compare_files(const void *v1, const void *v2, void *v)
bb_t *bb = (bb_t*)v;
const entry_t *e1 = *((const entry_t**)v1), *e2 = *((const entry_t**)v2);
+ int sign = 1;
if (!bb->interleave_dirs) {
- // Ingore sign
- if (E_ISDIR(e1) != E_ISDIR(e2))
- return E_ISDIR(e1) < E_ISDIR(e2) ? 1 : -1;
+ COMPARE(E_ISDIR(e1), E_ISDIR(e2));
}
for (char *sort = bb->sort + 1; *sort; sort += 2) {
- int sign = sort[-1] == '-' ? -1 : 1;
+ sign = sort[-1] == '-' ? -1 : 1;
switch (*sort) {
case COL_SELECTED: COMPARE(IS_SELECTED(e1), IS_SELECTED(e2)); break;
case COL_NAME: {
diff --git a/config.def.h b/config.def.h
index 17d31a7..5cf4cdf 100644
--- a/config.def.h
+++ b/config.def.h
@@ -29,6 +29,7 @@
deselect:<filename> Deselect <filename>
dotfiles:[01] Whether dotfiles are visible
goto:<filename> Move the cursor to <filename> (changing directory if needed)
+ interleave:[01] Whether or not directories should be interleaved with files in the display
jump:<key> Jump to the mark associated with <key>
mark:<key>[=<path>] Associate <key> with <path> (or current dir, if blank)
move:<num*> Move the cursor a numeric amount