atom/tree-view — pull request #87 by renz45 (2014-03-13 16:42:09+00:00)
Title: Fix selection bug when selecting files inside of a symlinked directory

I ran into a problem where files within a symlinked directory required two clicks to be selected. I figured out that it had something to do with the path name saved on the fileView being local to the current structure instead of absolute through the symlinked directory. The guilty code is: https://github.com/atom/tree-view/blob/master/lib/tree-view.coffee#L82 I'm guessing this updates the tree view if the current open file changes, the problem is that the tree-view itself triggers this change.

![symlink_bug_before_fix](https://f.cloud.github.com/assets/599521/2412020/a785890a-aacd-11e3-81aa-8fde14ef96a9.gif)

The fuzzy finding of: https://github.com/atom/tree-view/blob/master/lib/tree-view.coffee#L245 gets the path from the atom.workspace, which seems to follow symlinks correctly, giving the absolute url and compares it to the path stored on the fileView, which is local to the current atom project. Since these paths don't end up matching, it selecting a directory further up as a best guess.

I've been trying all afternoon to come up with a test for this, but the atom.workspace used in tests doesn't appear to fire the correct events when selecting files programmatically, so this bug never seems to manifest.

Here is the behavior after adding this small change:

![symlink_bug_after_fix](https://f.cloud.github.com/assets/599521/2412074/4ed1af9a-aace-11e3-9971-b93bd5ef636e.gif)