n4n0GH / task

A simple to-do terminal application
Do What The F*ck You Want To Public License
22 stars 0 forks source link

Reuse old IDs #5

Open crabctrl opened 4 years ago

crabctrl commented 4 years ago

Would it be possible to allow reusing the IDs of tasks that have been deleted, to keep ID numbers low?

n4n0GH commented 4 years ago

Hm, current implementation only checks the last ID and increments based on that. So say you have tasks with IDs of 1, 2 and 13, the next added task would have ID 14. If you'd clear task 13 before adding a new task it'd get ID 3.

I guess I could change the checking method to see if there's "open spots" between the first and last task and reuse those IDs as well.

Good idea!