This feature is available in gedit via a plugin which displays document statistics in a small dialog window. Maybe the code could be used to implement the same functionality in Mousepad.
As for #44 (closed), a way to achieve this for now is to open the "Find and Replace" dialog, enable the "Replace all in document" option, and search for the regex [^\s]+ for word count, . for characters count (newline excluded), etc.
This might be slow with big files though…
NB: for the moment, the regex search is only available by compiling from master in fact…
Should the plugin work just like the Gedit counterpart?
Where should the menu option be located? In the View menu? In the search menu?
Or maybe it could display the word count on the status bar? But the latter would require re-computing words on every keystroke, right? I don't think it is required on the status bar though, as it is something that is only needed occasionally.
Yes, I suppose it would be unnecessarily expensive to update these counters every time you hit a key. Perhaps a small document statistics dialog as in gedit would be preferable? Accessible from the document menu then?
I would say the View menu is more appropriate since the document menu is for changing the document properties. The search menu is also a candidate albeit not as appropriate as the view menu.
If I were to verbalize this action I would probably say "show" me the word count (View), or less likely, "search" for all words (Search).
So do you agree with the View menu?
Personally I would think of Word Count more as a Tool, than a View, but that is probably just habituated from other software, and I think they are both perfectly reasonable choices. I agree with @no149 that it can be thought of as either a "show me" View, or as a calculation tool like search. Perhaps a right-click context menu option would (also?) suit?
You could alternatively/also do it like Notepad++ whereby the character and line length is always shown in the status bar, and these can be double clicked on to bring up the full word/character count results. But I'm not sure how obvious that is for the user in terms of discoverability.
"Document Statistics" is perhaps a little vague, and gives the impression that it would only provide information on the entire file, rather than the selection (though it certainly would be nice to have included among other general document properties). From a UX perspective, I would consider the ability to run it on the selected block of text to be the higher priority. If no text is selected it could output the results of the entire file. If it is not difficult to implement, and there is no risk of calculating for the entire file ever becoming computationally expensive/slow for exceedingly large files, then the safest/clearest option for meeting any user's expectation would be to output both. I.e. the output clearly indicates the word and character counts separately for both the selection, and the entire document. If there is any risk that the latter could become expensive/slow, then it could be simply left out (but still showing clearly that the results shown are just for the selected text), or possibly have the ability to display the results of the selection immediately as priority, while the results for the entire document are still be calculated in the background and updated in the displayed results once ready.
For character counts there is the choice of whether to include line endings or not, and whether to indicate which preference is being used or give any choice in this. I guess excluding them would be the more usual/expected choice?
For word counts I'm wondering about how best to handle name initials (with/without punctuation and/or spaces), equations, hyphenated words, or number ranges separated by a hyphens, en-dashes, or em-dashes in the cases without including any spaces. I think it is reasonable if spaces, tabs and line endings are always counted as word separators, but no other characters/symbols are. And then you might also wish to exclude any individual symbols which are standing on their own separated by spaces so that we don't count as words things like bullet points, or dashes/hyphens surrounded by spaces etc. The ampersand might be one possible exception here.
Hello Mousepad Authors.
I really appreciate Mousepad,
for preparing and saving Records of My Typed Texts,
for Examples, My Twitter X and Facebook Articles,
and, especially, for Organisations' Online Forms,
that have Character Limits, eg, 1000 or 2000 Characters.
Please can You possibly create, A Character Count,
for The Current Text File, that appears in The Mousepad Status Bar, please.
Thank You, Michael Jenkins, in The UK. Tue 8 Oct 2024.
.