SublimeText / AdvancedNewFile

File creation plugin for Sublime Text
MIT License
829 stars 93 forks source link

Won't work if no files are open #100

Closed gabekneisley closed 10 years ago

gabekneisley commented 10 years ago

I use sublime text 2. If there are currently no files open, the keyboard shortcut does not work. If I open a file, the shortcut works again, and if I close them all, it does not.

Traceback (most recent call last):
  File "./sublime_plugin.py", line 339, in run_
  File "./advanced_new_file/commands/new_file_command.py", line 18, in run
  File "./advanced_new_file/commands/command_base.py", line 70, in run_setup
  File "./advanced_new_file/commands/command_base.py", line 38, in __generate_alias_root
  File "./advanced_new_file/commands/command_base.py", line 96, in __parse_path_setting
AttributeError: 'NoneType' object has no attribute 'file_name'
skuroda commented 10 years ago

Are there any errors in the ST console?

gabekneisley commented 10 years ago

Yes, there is. :) Edited original issue with the the stack trace. Thanks!

bachue commented 10 years ago

I have the same issue on ST2

skuroda commented 10 years ago

Apologize for the delay, I've been busy the past few weeks so haven't had a chance to finish pull in the changes for this yet. Also doing the copy command from #99. Hopefully it'll be done this week.

ctf0 commented 10 years ago

a slightly diff behavior on ST 3062 , 1-i can use the plugin without any opened files or folders but the created files/folder will go to the home dir because the "default_path" is set to "~" ,btw the "default_root": "" doesn't need to be set as root. 2-i found that changing the "default_root" to current is better because the plugin will now create the files/folder right next to the opened file wither it was a part of project folder or by it self.

skuroda commented 10 years ago

Hi everyone, I apologize for the delay. Wasn't a terribly difficult fix, but I've been really busy lately (and hitting times of not being as motivated as normal). Anyways, I appreciate everyones use of ANF. A fix has been pushed in 1.3.0. Please let me know if you run into any other issues.