Sublime Forum

Goto search functionality is failing to find a file (possible bug?)

#1

When I search for a file using the Goto (Cmd+T / Cmd+P) search bar, it is not finding the file, despite the fact that the file definitely exists (I checked) inside one of the subfolders of the folder that I have open in Sublime.

The file, named “tunnel_to_redshift.command”, is in the folder “docs”. However, when I search for it, it isn’t showing up in the search results. I notice that in the sidebar, it also isn’t showing up there, and there’s some sort of “link” or “chain” icon on top of the folder icon next to “docs”. I haven’t been able to figure out what this means, despite a lot of googling. Anyone have any idea what it means?

In my user settings, I have overrode file_exclude_patterns and folder_exclude_patterns to exclude nothing, so the problem shouldn’t be that I’m excluding the file:

"file_exclude_patterns":
[
],
"folder_exclude_patterns":
[
],

Edit/addendum: if I cd to the redshift folder and then open that folder in sublime with subl ., then I see the files that were previously missing in the sidebar. Furthermore, if I open up the Goto search bar, I can now find tunnel_to_redshift.command in the search results.

0 Likes

#2

If anyone could tell me what that symbol on top of the folder means, that could be really helpful for me to figure out what the problem is.

0 Likes

#3

The chain icon on a folder indicates that Sublime thinks that the folder in question is a link to another folder that already exists in the project. Such folders don’t show any content because it would be possible to create a directory structure where a lower descent links upwards to it’s parent, which would make the sidebar nest infinitely.

I would expect that in this case the file in question should be available via some other folder in the project, though.

Potentially you’re bumping against the following issue?

0 Likes

#4

Thanks for the info. I looked at that issue, and I don’t think I’m having the same issue. The “docs” folder is a real folder (drwxr-xr-x), and as far as I can tell, there are no other symlinks to that folder. I searched for symlinks to the “docs” folder and came up with no results.

0 Likes

#5

Is there any possibility that the folder in question is a hard link?

I believe that under Linux a hard link would share the same inode as the other linked file(s) since they are essentially just duplicate file system entries that point to the same file data, and since @wbond mentioned that it uses inode information to detect duplicates, that might make it think it’s seen the folder and stop. Although that still seems as if the data should be available in the “other” folder.

0 Likes

#6

I’m not sure if it’s a hard link (despite some googling to try to figure it out – this is unfamiliar territory for me). When I do stat -x docs I get:

File: “docs”
Size: 128 FileType: Directory
Mode: (0755/drwxr-xr-x) Uid: ( 502/kevin.liu) Gid: ( 20/ staff)
Device: 1,4 Inode: 1416873 Links: 4
Access: Mon Mar 5 16:45:42 2018
Modify: Mon Feb 26 16:08:48 2018
Change: Mon Feb 26 16:08:48 2018

I notice that it says “Links: 4” which seems to imply there are 3 other things linking to this folder, right? But this is confusing to me, because I tried pretty hard to find anything that’s linking to this folder but couldn’t find any results.

If I do find ~ -samefile docs (my current directory is the “redshift” directory containing the “docs directory”, and I can’t imagine that anything outside of my ~ is linking to this folder, since it’s from a github repo), I only get 1 result

If I do find ~ -inum 1416873 I likewise get only 1 result.

I’ve tried the things suggested here, here, and here: unix.stackexchange.com/questions/35292/quickly-find-which-files-belongs-to-a-specific-inode-number (sorry, apparently new users can only post 2 links per post).

0 Likes

#7

I think that whether it’s a link or not (either hard or soft) shouldn’t matter unless another link to the same thing also appears in the project. That is, if you for example link a folder in a project to another folder in a project, one of them should display and the other should have the link icon on it to tell you that it’s a link, and be otherwise empty.

So on the face of it, it seems somewhat weird that it would decide that the folder is a link and not show the contents unless the “other” link was a part of the project, and in that case you should be able to still find the file anyway, but it would appear to be from a location other than what you expect.

The fact that it works if your project only contains the redshift directory (for example when you open just that folder) would seem to indicate that whatever the other link is, it’s in one of the other folders that you have open or something. However I’m not sure where to go from there because it seems as though the search have produced a result in that case.

0 Likes

#8

Agreed. Not sure what else I can do at this point, but this isn’t a show-stopper so I’m going to set it aside for now. Thanks anyways for your help!

0 Likes