magit-todos icon indicating copy to clipboard operation
magit-todos copied to clipboard

Double sections

Open seagle0128 opened this issue 2 years ago • 6 comments

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

image

seagle0128 avatar Apr 09 '22 17:04 seagle0128

What happens if you press g a third time?

alphapapa avatar Apr 09 '22 23:04 alphapapa

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?

seagle0128 avatar Apr 11 '22 01:04 seagle0128

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.

alphapapa avatar Apr 11 '22 12:04 alphapapa

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

seagle0128 avatar Apr 11 '22 16:04 seagle0128

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 avatar Apr 13 '22 16:04 alphapapa

See also: #145

alphapapa avatar Aug 26 '23 22:08 alphapapa