atom-wordcount
atom-wordcount copied to clipboard
Word count changes if a non-active tab is updated
I have two tabs open, main.tex
(active) and main.log
.
When I compile my TeX file outside of Atom, main.log
changes. Atom automatically refreshes the file contents even though that file tab is not active, but the word count indicator in the status bar changes too! Even though I am still viewing main.tex
, the indicator now shows me the word count of main.log
, even though that tab is not active.
Hey @johnjcamilleri that indeed sounds like a bug, and my guess for the caue is that the view is updated on keystoke events https://github.com/nesQuick/atom-wordcount/blob/master/lib/main.coffee#L27-L28 so there is no eventlistener for a fs file change. But it can be implemented, this might be a good starting point: https://atom.io/docs/api/v1.0.7/TextEditor#instance-onDidChange