From a7e62a538e544aea73e8790e032153301dfeed8c Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Sat, 23 Oct 2021 22:17:09 -0700 Subject: [PATCH] Revert "Swap file size and file type description position in pager" This reverts commit d8722a3ddf9955afaf8dbd47bf88bc948268e345. I underestimated the value of having the file sizes easier to eyeball and compair. Back to the drawing board. --- src/wildcard.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 54636236d..2e93e44b9 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -38,7 +38,7 @@ /// Description for block device. #define COMPLETE_BLOCK_DESC _(L"Block device") /// Description for fifo buffer. -#define COMPLETE_FIFO_DESC _(L"fifo") +#define COMPLETE_FIFO_DESC _(L"Fifo") /// Description for symlink. #define COMPLETE_SYMLINK_DESC _(L"Symbolic link") /// Description for symlink. @@ -509,14 +509,14 @@ static bool wildcard_test_flags_then_complete(const wcstring &filepath, const wc // Compute the description. wcstring desc; if (expand_flags & expand_flag::gen_descriptions) { - if (file_size >= 0) - desc = format_size(file_size); - if (!desc.empty()) { - desc.append(L", "); - desc.append(file_get_desc(lstat_res, lstat_buf, stat_res, stat_buf, stat_errno)); + desc = file_get_desc(lstat_res, lstat_buf, stat_res, stat_buf, stat_errno); + + if (file_size >= 0) { + if (!desc.empty()) desc.append(L", "); + desc.append(format_size(file_size)); } } - + // Append a / if this is a directory. Note this requirement may be the only reason we have to // call stat() in some cases. auto desc_func = const_desc(desc);