Home Download Buy Blog Forum Support

Goto Anything picks low-ranked file

Goto Anything picks low-ranked file

Postby adzenith on Tue Oct 25, 2011 7:54 pm

I have a file called callbacks.c, and my IDE makes a ton of associated files that I want to look at frequently enough that I don't exclude them from the project. Fortunately, Sublime Text 2 uses some magic algorithm to realize that I want .c and .h files more than, say, .i files.
Now say I'm trying to open callbacks.c using goto anything. Everything seems to be working fine:
Screen Shot 2011-10-25 at 12.44.47.png
Screen Shot 2011-10-25 at 12.44.47.png (28.69 KiB) Viewed 571 times

but I'm tying really fast, and now I hit c and suddenly Goto Anything thinks I want a different file:
Screen Shot 2011-10-25 at 12.44.57.png
Screen Shot 2011-10-25 at 12.44.57.png (29.75 KiB) Viewed 571 times

Coincidentally this is always around the time that I hit enter to open the file, and I end up having to retry and slow down.
What am I doing wrong? It seems like it shouldn't be selecting callbacks.lst, because its match rank is only 548 to callbacks.c's 590.
Thanks!
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: Goto Anything picks low-ranked file

Postby adzenith on Tue Oct 25, 2011 9:34 pm

Incidentally if I then hit "k" the selection pops back up to "callbacks.c".
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: Goto Anything picks low-ranked file

Postby jps on Wed Oct 26, 2011 12:28 am

My hunch is that this is related to it remembering your selection for previously entered terms, rather than something to do with typing fast. You can verify this by editing your .sublime-session (if you aren't using a project) or .sublime-workspace (if you are using a project) and removing the "select_file" key, which maps search terms to the selected file.
jps
Site Admin
 
Posts: 3058
Joined: Wed Mar 19, 2008 12:33 pm

Re: Goto Anything picks low-ranked file

Postby adzenith on Wed Oct 26, 2011 1:21 am

That is exactly what it was. I had
Code: Select all
         [
            "callbac",
            "Project/Debug/List/callbacks.lst"
         ],

in there.
It's related to typing fast only in that when I'm tying fast I'm not really paying attention to the actual results, and I get surprised when it suddenly picks a file I wasn't expecting. :)
Is there any way I can stop it from maintaining a select_file list? It's a cool feature, I think, but it also requires me to hold more state in my brain. I'd rather type "calllst" or something to get the list file than have it remember (and have to remember myself) that "callbac" means "callbacks.lst".
adzenith
 
Posts: 1204
Joined: Mon Oct 19, 2009 9:12 pm

Re: Goto Anything picks low-ranked file

Postby C0D312 on Thu Oct 27, 2011 11:18 pm

I discovered a similar issue. If I have two files with the same name in my project, but one of them is open, I want Goto File to give priority to the open file.
C0D312
 
Posts: 1063
Joined: Sun Jul 10, 2011 3:23 am


Return to Technical Support

Who is online

Users browsing this forum: Exabot [Bot], Google [Bot] and 26 guests

cron