aziz / PlainTasks

An opinionated todo-list plugin for Sublime Text editor (version 2 and 3)
MIT License
3.29k stars 286 forks source link

Updating statistics at bottom #400

Open 3milio opened 5 years ago

3milio commented 5 years ago

It appears that the statistics at the bottom (ie, overall document statistics) don't get updated when you remove task items, until you take focus off the document then return to it.

For example, if I have 3 out of 10 tasks marked as done the bottom statistics will say, "3/10 done (30%)". But if I remove two of them, it doesn't update the statistics until I switch to another document or application the come back to it. At that point it'll say, "3/8 done (37%)".

Given that those statistics get updated immediately when adding new tasks, I'd think they're intended to work the same way when removing tasks.

vovkkk commented 5 years ago

I'd think they're intended to work the same way when removing tasks.

No, it is not intended. A task is being added with command (you don‘t just type something, but trigger a command) thus the plugin knows that amount of tasks was changed hence we have to update statistics. But when you remove a task it is the same as you would type/remove something randomly, i.e. we cannot know if amount of tasks was changed without actually count them hence we would have to count them each time something is changed like you type one letter—we check amount of tasks, you remove the letter—we check amount of task, and so on. So it might be too heavy. This is about the current way it works: random editing is ignored.

It does not mean we cannot change it. TBH I don’t even remember if tried to resolve it previously, I guess when it was added it looked good enough.