kinabalu/obsidian-word-sprint

Word count should calculate / increase even if you switch notes

kinabalu opened this issue · 6 comments

Word count should calculate / increase even if you switch notes

Currently we just grab the active workspace and calculate from there. we could likely listen for any open or opened notes and add them to an array with an object identifying previous word count (if the note is not empty) and having that keep any notes that were in play during a sprint as part of our "count"

actually, it appears that the entire thing really hinges on that if you open another file with text in it, we have to overcome the previousWordCount stat

I did a little digging ... and it hinges on a few oddities, and to solve it we likely need to tie metrics to a map which contains the note name so we can store separate stats for every opened note. it won't be simple but that's probably most effective way.

At the moment if you switch notes it calculates the written words in this new note as negative. So, I end up with a negative word count for the day despite the fact I have not deleted a single word.

Yeah, it has no idea what document it's referencing for the sprint. I'm sure we can make that a bit smarter though, the best thing for now is not to switch notes and write in a single document until I've gotten a chance to add something that makes sense here.

This would be a really nice addition to the plugin if it is still planned.