At first blush, this seems to work OK for me with the settings that you mentioned in your post above.
With the default settings, the plain text file on the left reports as ten words:
With the setting you provided above, it starts reporting as only five words as I would expect:
That said, the entirety of the WordCount.sublime-settings
here is purely default except for changing the strip
setting, so potentially some of the other settings may in some way interfere with it working if you’ve modified them.
There are also a few problems with the package, so that may be getting in your way. For example it doesn’t seem to detect when the syntax in the view changes, so for example changing the syntax to HTML
keeps the word count as five until you make a modification, then it remains at ten when you switch back to Plain Text
until you make a further modification.
As such, you may need to modify the file to get it to notice that the count has updated.
I also noticed that it stopped working for a while, and my console was filling up with many of this error message:
KeyError: 'count'
Traceback (most recent call last):
File "WordCount in /home/tmartin/local/sublime_text_3_sandbox/Data/Installed Packages/WordCount.sublime-package", line 295, in <lambda>
File "WordCount in /home/tmartin/local/sublime_text_3_sandbox/Data/Installed Packages/WordCount.sublime-package", line 132, in run
The referenced line of code is for the update of the status line for the word count, where it’s accessing a dictionary which spontaneously no longer has the required count
view setting to track the word count. It’s communicating with a background thread of some sort, so there may be some sort of syncronization issue.
In any case, I would also check the console output (View > Show Console
) to see if it’s doing that or not. I didn’t spend much time trying to reproduce whatever it was I did that made it angry, so it may just have been the syntax changing.