From 0f2ee308deefcc4e796bece6deae1ad383a22427 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Wed, 22 Jan 2014 17:50:03 -0800 Subject: [PATCH] Use ellipsis in pager progress message --- pager.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pager.cpp b/pager.cpp index b08e8359e..40a5c9dd6 100644 --- a/pager.cpp +++ b/pager.cpp @@ -798,16 +798,19 @@ int pager_t::completion_try_print(size_t cols, const wcstring &prefix, const com assert(stop_row - start_row <= term_height); completion_print(cols, width, start_row, stop_row, prefix, lst, rendering); + /* Ellipsis helper string. Either empty or containing the ellipsis char */ + const wchar_t ellipsis_string[] = {ellipsis_char == L'\x2026' ? L'\x2026' : L'\0', L'\0'}; + /* Add the progress line. It's a "more to disclose" line if necessary. */ wcstring progress_text; if (rendering->remaining_to_disclose == 1) { /* I don't expect this case to ever happen */ - progress_text = L"and 1 more row"; + progress_text = format_string(L"%lsand 1 more row", ellipsis_string); } else if (rendering->remaining_to_disclose > 1) { - progress_text = format_string(L"and %lu more rows", (unsigned long)rendering->remaining_to_disclose); + progress_text = format_string(L"%lsand %lu more rows", ellipsis_string, (unsigned long)rendering->remaining_to_disclose); } else {