Hmm… for those of you who are having issues, could you please open your console (control + ` ) and tell me what appears after you press control + space?
Could you give me a sample of your code to test with? I don’t use PHP and it would be helpful for me to see the problem firsthand. Thanks.
I reproduced the bug that is described above pod.
if you open the editor and start working, it is like in the screenshot - no files in the auto-completion.
but if you open and reload autоfilename.py (just save without changing anything), then the auto-completion is beginning to show the files.
pod - try to repeat my actions - open the file autоfilename.py and simply save it, and then try again auto-completion
I just released a fix. Windows users, you could test it and make sure it works? I made some changes how it handles paths so I need someone to test on Windows. Thanks.
Just reinstalled from package manager, now it doesn’t work at all. No messages/errors in console as well. Also doesn’t work after reloading.
I’m afraid this report will not help you
[quote=“pod”]Just reinstalled from package manager, now it doesn’t work at all. No messages/errors in console as well. Also doesn’t work after reloading.
I’m afraid this report will not help you [/quote]
Hmm… I guess os.path.join is not as smart as the description on the docs said… Could you do me a favor and see if it works when you press \ instead of /?
I’m not really sure what that’s supposed to mean… AutoFileName does all of its work at runtime. So I don’t know how a restart can change anything. Do you mean a restart just after installing it or every time to get it to work?
I’m not really sure what that’s supposed to mean… AutoFileName does all of its work at runtime. So I don’t know how a restart can change anything. Do you mean a restart just after installing it or every time to get it to work?[/quote]
omg, I found my problem !
I had another old copy of the autofilename.py in another directory when he was not in the package manager.
Now the only issue I have is that all items in auto-complete box have backslash ‘’ instead of normal slash ‘/’.
I believe I can fix it by replacing d += os.path.sep with d += ‘/’ correct?
Now the only issue I have is that all items in auto-complete box have backslash ‘’ instead of normal slash ‘/’.
I believe I can fix it by replacing d += os.path.sep with d += ‘/’ correct?[/quote]
I changed this because when I was trying to fix all the windows bugs, I changed all references of ‘/’ to os.path.sep I’ll change it back though.
It would be marvellous if the plugin would somehow use the Sublime Project root as “/”, because it’s often the case that my CSS files are in /css/ and my images are in /images/, and all of my references to files in CSS are absolute paths. So instead of background: url(…/images/bg.png), I use background: url(/images/bg.png). In this context, the plugin is of no use
Also, is there some way to have the auto-complete window make suggestions immediately as I type, rather than after a manual invocation with CTRL+SPACE? It was also unable to complete a filename if I began typing one that I knew already. IE: …/images/backg[CTRL+SPACE] yields no suggestions, even though I have a background.png image in there.
Just thought I’d post my feedback! Thanks for making this
The Sublime Text API doesn’t have much support for working with projects, so this request might be pretty difficult to implement… I’ll look into it but it might be more work then it’s worth.
This is already possible if you add the following to your Settings file (Preferences > Settings - User): [code] “auto_complete_triggers”:
{
"characters": "<",
"selector": "text.html"
},
{
"characters": "/",
"selector": "text.html, source.css"
}
][/code] (The '<' part is from your default settings so you don't want to override that.) Essentially, ST2's autocomplete will activate when you type letters. This setting gives exceptions, other characters that also trigger the autocompletion popup. As for why ../images/backg[CTRL+SPACE] yields no suggestions, this is because the plugin checks if the previous character is a /. If the autocomplete is already up though, this is not a problem.