Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CLOSED] File in editor not selected in project tree if folder expanded after file already open #3198

Open
core-ai-bot opened this issue Aug 29, 2021 · 5 comments

Comments

@core-ai-bot
Copy link
Member

Issue by redmunds
Wednesday Apr 10, 2013 at 18:19 GMT
Originally opened as adobe/brackets#3404


This issue was split off from pull adobe/brackets#3398. Not sure if this is an Issue or a Feature Request:

  1. Run Find in Files such that the results contain a file that is in a collapsed folder, and also not in the working set
  2. Select that file in Find in Files results panel
  3. Verify that file is correctly shown in editor and there's no visible selection in file tree or working set
  4. Manually expand folder that contains the file in editor

Result:
Folder expands, but file is not visibly selected

Expected:
File in editor to be selected in file tree once it becomes exposed

@core-ai-bot
Copy link
Member Author

Comment by njx
Thursday Apr 18, 2013 at 20:04 GMT


Reviewed. To me, low priority.

@core-ai-bot
Copy link
Member Author

Comment by peterflynn
Thursday Apr 18, 2013 at 21:30 GMT


This works in the general case because of specific code we wrote that listens for "open_node.jstree" and calls _forceSelection(..., _lastSelected); to ensure that any newly-revealed child node that matches the current file get highlighted as selected. But the problem is that _lastSelected is stored as a DOM node, so we can't set it to anything meaningful when the current document does not exist in the tree yet (because its folder has never been expanded since launch -- i.e. this bug's repro case). See the if (!nodeFound) case in _documentSelectionFocusChange() for where we bail on this.

We could also take this opportunity to do some code cleanup -- it seems like we could just check against DocumentManager.getCurrentDocument() instead of manually storing & maintaining our own "last selected" state.
I think _lastSelected has gotten overloaded a bit anyway -- it looks like it was originally used only to revert the selection back to a truly previous file when opening the clicked item fails due to I/O error. Maybe restoring it to that limited use would be best...

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Wednesday Sep 17, 2014 at 15:23 GMT


I just confirmed that this will be fixed when #8788 is complete.

@core-ai-bot
Copy link
Member Author

Comment by dangoor
Wednesday Oct 01, 2014 at 20:05 GMT


FBNC@redmunds

@core-ai-bot
Copy link
Member Author

Comment by redmunds
Wednesday Oct 01, 2014 at 21:10 GMT


Confirmed. Closing.

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

No branches or pull requests

1 participant