file-icons / atom

Atom file-specific icons for improved visual grepping.
MIT License
1.31k stars 250 forks source link

Check if the same file is created before removing from FileSystem #836

Closed utkarshgupta137 closed 3 years ago

utkarshgupta137 commented 3 years ago

Fixes issues mentioned in #693

Summary: Whenever a file is "deleted" & "created" instantaneously, which can happen when formatters are run or git modifies the file, then the resource for the file gets destroyed and never gets created again. This adds a check to see if the file is created in the same call.

utkarshgupta137 commented 3 years ago

Hey, do you know how file icons are managed in tabs? Sometimes the icons in tree-view & tabs are out of sync. It seems this PR only solved this for tree-view and not for tabs.

Alhadis commented 3 years ago

@utkarshgupta137 Could you elaborate? (Preferably with a reproducible test-case).

To answer your question, though, the tabs package handles icons the same way as tree-view does: via the API.

utkarshgupta137 commented 3 years ago
image

Here is an example of tabs & tree-view out of sync. I haven't been able to reliably reproduce it. The tree-view package almost always shows the correct state. It's the tabs package which is out of sync and showing the wrong info.