elif "./" in view.substr(sublime.Region(sel-3,sel)):
the code works fine withbackground: url(../);
but don’t works withbackground: url(../img/);
small fix:
elif "/" in view.substr(sublime.Region(sel-2,sel)):
What are your thoughts on this?
elif "./" in view.substr(sublime.Region(sel-3,sel)):
the code works fine withbackground: url(../);
but don’t works withbackground: url(../img/);
small fix:
elif "/" in view.substr(sublime.Region(sel-2,sel)):
What are your thoughts on this?
Instead of using hard coded path separators for Linux/MacOS and Windows, instead use os.path.sep
dir_len = this_file.rfind(os.path.sep)
There are plenty of path manipulation functions in the os.path module http://docs.python.org/release/2.6.7/library/os.path.html?module-os.path
Most of them are OS independent.
os.path.split() is probably what you want.
The plugin is now available through Package Control.
If you would like to submit a fix or new feature, pull requests are welcome: https://github.com/BoundInCode/AutoFileName/pulls
Just released a fixed that should appease the complainers…
Thanks, now it looks more stable. As for css, autocomplete still doesn’t work for non-quoted url declaration.
It works fine.
Your last char in path must contain backslash /, and only then press CTRL+SPACE
for example:
background: url(./)
background: url(../)
background: url(img/)
background: url(../img/)
|
^-cursor after slash
I installed by package manager and can’t really see anything happening when coding in PHP?
Yes, that is how I was testing it. I’m on windows7x64, sublime b2165, installed from package manager and I still having issues.
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 /?
In linux still starts to work [size=110]only after a restart[/size] the plug-in, as described above.