From 961ac49f81eb9f4de7acb1adfd8836b07857fe2c Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 31 May 2019 13:26:23 -0700 Subject: Simplifying interleave code and adding doc --- bb.c | 7 +++---- config.def.h | 1 + 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: Deselect dotfiles:[01] Whether dotfiles are visible goto: Move the cursor to (changing directory if needed) + interleave:[01] Whether or not directories should be interleaved with files in the display jump: Jump to the mark associated with mark:[=] Associate with (or current dir, if blank) move: Move the cursor a numeric amount -- cgit v1.2.3