Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Displaying deleted files #634

Open
adamreisnz opened this issue Jan 5, 2016 · 7 comments
Open

Displaying deleted files #634

adamreisnz opened this issue Jan 5, 2016 · 7 comments

Comments

@adamreisnz
Copy link

I assume find & replace uses some kind of caching system for all files when searching in project files, but when I delete a file through Atom, it should probably trigger an event to remove that file from the cache.

Currently, after having deleted a file, it will still show up in the search results, which is confusing at best.

Possibly related, but the fuzzy finder module is also plagued by this issue, see atom/fuzzy-finder#168

@adamreisnz
Copy link
Author

It may have to do with the file still being open in a tab (see atom/tabs#160)
To reproduce:

  1. Create a test file, add some easy to find content like ABCABCABC
  2. Save the file
  3. Verify that searching for ABCABCABC in files shows up the file
  4. Close search panel
  5. Delete the file from tree view
  6. Search in files again for ABCABCABC
  7. The deleted file shows up, clicking it opens a new tab with empty contents:

image

The first tab is the reference to the delete file. The second tab is what opened up after searching and clicking on the result.

@acontreras89
Copy link

@anderoonies can you test if this is (as well) due to node-pathwatcher not firing delete events for files moved to the trash on OSX?

@anderoonies
Copy link
Contributor

gladly, i'll update as soon as i get back to my machine and have a chance

update: looks like rm <file> in Step 5. of @adambuczynski's workflow fixes this issue, which points to it being a result of that problem exactly. i am having issues with editing the node-pathwatcher package, though, which will make this difficult to confirm.

@acontreras89
Copy link

atom/node-pathwatcher#106 has been merged, which may solve this problem. @adambuczynski can you ensure this is working properly with the latest version of node-pathwatcher?

@adamreisnz
Copy link
Author

@acontreras89 so this is partially fixed, I guess it depends on how find and replace should work.

When I follow the above steps now, the tab of the deleted file is properly removed, and when I close the find and replace panel and open it again to search, the deleted file does not show up.

However, when you leave the panel open and try searching for the same term again, it does not perform a new search, and your previous result (including the deleted file) still shows up. This may or may not be the intended behaviour of find and replace, so I can't classify it as an outright bug. But when you click on the deleted file in the search results, the same happens, e.g. an empty tab is opened with the same file name, but pointing to a non existing file. After you do that, the result disappears from the find and replace search results.

@lee-dohm
Copy link
Contributor

lee-dohm commented Mar 9, 2016

Personally, I think it would be best if the corresponding entries could be removed from the find-in-project view.

@acontreras89
Copy link

I created a pull request to address this. Will wait for feedback before working any longer on it, though.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants