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

Select files after paste operation #631

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

glangford
Copy link
Contributor

Fix #573

@50Wliu
Copy link
Contributor

50Wliu commented Oct 29, 2015

Hi @glangford, can you please add specs to this? Thanks!

@glangford
Copy link
Contributor Author

Specs updated.

@glangford
Copy link
Contributor Author

select-after-paste

@glangford
Copy link
Contributor Author

Additional commentary on Git status

Note that this PR also fixes the latent problem of git status being incorrectly shown on paste. The solution is included as part of selectOnCreate() at the moment. However, the proper fix is likely in files.coffee; note that in updateStatus(), the git status is retrieved from the cache. I have verified that pasted files will have no entry in the GitRepository cache, so a status of null is returned when they are initially constructed and displayed in the tree view.

Because the file status in cache is null, the parent directory status was also incorrect. (Repro in master by copying and pasting files into a directory, change focus to another app, then change focus back).

So an additional commit would be to change updateStatus for class File to include

status = repo.getCachedPathStatus(@path) ? repo.getPathStatus(@path)

rather than just

status = repo.getCachedPathStatus(@path)

Let me know if this sounds ok.

References

https://github.com/atom/tree-view/blob/master/lib/file.coffee#L55

https://github.com/atom/atom/blob/7d743827820969871e8724e6f353887a3ddfc105/src/git-repository.coffee#L338

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

Successfully merging this pull request may close these issues.

2 participants