Simplifying interleave code and adding doc

This commit is contained in:
Bruce Hill 2019-05-31 13:26:23 -07:00
parent 17ce3f08df
commit 961ac49f81
2 changed files with 4 additions and 4 deletions

7
bb.c
View File

@ -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: {

View File

@ -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