kinabalu / obsidian-word-sprint

Obsidian Word Sprint plugin
MIT License
41 stars 6 forks source link

Word count should calculate / increase even if you switch notes #19

Closed kinabalu closed 1 month ago

kinabalu commented 2 years ago

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"

kinabalu commented 2 years ago

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

kinabalu commented 2 years ago

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.

Drakemoor commented 1 year ago

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.

kinabalu commented 1 year ago

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.

reallemon commented 1 month ago

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