alphapapa / magit-todos

Show source files' TODOs (and FIXMEs, etc) in Magit status buffer
GNU General Public License v3.0
748 stars 48 forks source link

Double sections #127

Open seagle0128 opened 2 years ago

seagle0128 commented 2 years ago

While pressing g twice, two Todos sections are displayed in magit-status buffer as below.

image
alphapapa commented 2 years ago

What happens if you press g a third time?

seagle0128 commented 2 years ago

What happens if you press g a third time?

Only one TODOs section is displayed.

To be clear, I mean the issue appears while double pressing g quickly. Otherwise the behavior is normal. I think it may be related to the async operations?

alphapapa commented 2 years ago

Yes, there is nothing to stop the async process from being run multiple times at once and thereby inserting multiple sections. AFAIK it does no harm and would probably not be worth writing code to prevent this.

seagle0128 commented 2 years ago

I agree it does no harm, but I'd like suggest to check before inserting the TODO section if possible.

alphapapa commented 2 years ago

It could be done, but it's not a priority for me, because this falls into the "well, don't do that" category. :) Patches welcome.

alphapapa commented 1 year ago

See also: #145