sublime-jekyll
sublime-jekyll copied to clipboard
Showing Command Palette creates "untitled" document
trafficstars
Summary of issue
If Jekyll is enabled, opening the Command Palette in a window with no document causes a new "untitled" window to be created. The Jekyll plugin is probably trying to access active document properties without checking whether an active document exists.
System details
- macOS 13.5
- Sublime 4143
- Jekyll package enabled
Sublime console output
No output.
The cause is in determine_path which insists on a document view.
if not self.window.views():
view = self.window.new_file()
else:
view = self.window.active_view()
auto = get_setting(view, 'jekyll_auto_find_paths', False)
Replacing with this seems to work fine:
auto = get_setting(self.window.active_view(), 'jekyll_auto_find_paths', False)
I'm not in front of a machine to test this change, but it looks fine. Thx for submitting - I'll try and get an updated version out shortly.
https://github.com/23maverick23/sublime-jekyll/blob/master/jekyll.py#L299-L317