Cog icon indicating copy to clipboard operation
Cog copied to clipboard

Add "Show in the File Tree" functionality

Open gkarag opened this issue 2 years ago • 7 comments

I have a long list of folders in the file tree pane. For one or another reason when the tree is scrolled in the pane or folders are expanded or collapsed it can be difficult to find the place of the currently selected folder or file.

I would like to have in the context menu of the files in the playlist to have a new item "Show in the File Tree" and as a consequence of selecting it, the file would show in the folder structure in the file tree pane.

gkarag avatar Jun 13 '22 10:06 gkarag

I wanted to create the same issue, but it's already here. Some inspiration can be found in JetBrains IDE. Button for select opened file in the tree: Screenshot 2022-07-17 at 18 46 16

LennyLip avatar Jul 17 '22 15:07 LennyLip

And that only has "inspiration" in showing me how it should behave, not how to code it. Because that IDE is written in Java, and I need to write this in native Cocoa code, either Objective C or Swift.

kode54 avatar Jul 18 '22 01:07 kode54

Not to diss this. I like the idea. I can try to implement this one soonish. I just need to implement functionality into the tree handler. Single file highlighting will be a lot easier than making a full search feature as requested elsewhere.

kode54 avatar Jul 18 '22 01:07 kode54

I'm just kind of taking a bit of a break right now, because my last few days of marathons have left me dreaming about coding stuff, and that annoys me as I think of the wackiest things while doing that, and none of them are all that useful, and I have a hard time tearing away from it to actually drag myself out of bed in the morning.

kode54 avatar Jul 18 '22 01:07 kode54

And that only has "inspiration" in showing me how it should behave, not how to code it. Because that IDE is written in Java, and I need to write this in native Cocoa code, either Objective C or Swift.

I meant just how it can look and works. I can't help, not familiar with Apple programming languages. But thank you for your hard work and take you time.

LennyLip avatar Jul 18 '22 04:07 LennyLip

It won't be hard to focus a single item. There's already code in the tree implementation to pick out the node for a given path. The only problem is, if you haven't expanded a particular node, its contents aren't filled in yet. So walking down the tree to a particular item will involve asynchronously expanding a node, waiting for its contents to be enumerated, then walking further down the tree.

Contents stay cached and remain resident in the tree even if you close a node later, but are lost when you quit the app and restart it. Naturally, I could abuse the method that is used to restore the preferences settings that remember which branches you've expanded.

kode54 avatar Jul 18 '22 07:07 kode54

For the record I happen to use an open source editor on Mac, TextMate, that has such functionality. It has "File Browser" menu from which one could select the currently edited file that may not be immediately selected in the browser.

gkarag avatar Jul 18 '22 09:07 gkarag