sublime-zig-language icon indicating copy to clipboard operation
sublime-zig-language copied to clipboard

Error when formatting while no folder is open

Open alvv-z opened this issue 3 years ago • 2 comments

When formatting a file without an open folder, Sublime Text 3211 and 4126 show an error in the console. I haven't tested this in other Versions.

Console Output:

Traceback (most recent call last):
  File "/opt/sublime_text/Lib/python33/sublime_plugin.py", line 1456, in run_
    return self.run(**args)
  File "/home/$USER/.config/sublime-text-3/Installed Packages/Zig Language.sublime-package/Zig.py", line 149, in run
KeyError: 'folder'

alvv-z avatar Feb 14 '22 23:02 alvv-z

I have encountered the same issue. The problem is line 149 of Zig.py, which looks like this: working_dir = vars.get('file_path', vars['folder']) I removed the . vars['folder'] and it works again. This is probably not a proper fix, but this should be the place to fix it.

gnarz avatar Mar 31 '22 12:03 gnarz