commit d3d2d324d21c61ef0f2b7f30541a20d31c66b7b9
parent 925a1a11f9dce6cea934dd1c1c43ac3024d30d53
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Sat, 21 Nov 2020 15:03:06 +0100
statusbar: properly pluralize the line+word+character count report
This avoids poor wordings such as "Words: 1 Lines: 1 Chars: 1".
Also, display the numbers in a more logical, ascending order: lines
first, words second, characters third. This is what 'wc' uses, too.
Diffstat:
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2987,9 +2987,12 @@ void do_wordlinechar_count(void)
openfile->current = was_current;
openfile->current_x = was_x;
- /* Display the total word, line, and character counts on the status bar. */
- statusline(HUSH, _("%sWords: %zu Lines: %zd Chars: %zu"), openfile->mark ?
- _("In Selection: ") : "", words, lines, chars);
+ /* Report on the status bar the number of lines, words, and characters. */
+ statusline(HUSH, _("%s%zd %s, %zu %s, %zu %s"),
+ openfile->mark ? _("In Selection: ") : "",
+ lines, P_("line", "lines", lines),
+ words, P_("word", "words", words),
+ chars, P_("character", "characters", chars));
}
#endif /* !NANO_TINY */