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.
master
Benno Schulenberg 2020-11-21 15:03:06 +01:00
parent 925a1a11f9
commit d3d2d324d2
1 changed files with 6 additions and 3 deletions

View File

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