Skip to content

Commit e4503ab

Browse files
Handle command calls in blank views
1 parent dcb0ca8 commit e4503ab

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

wrap.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55
class WrapCommand(sublime_plugin.TextCommand):
66
def run(self, edit):
77
settings = sublime.load_settings("Wrap.sublime-settings")
8-
extension = self.view.file_name().split(".")[-1]
8+
9+
file_name = self.view.file_name()
10+
if file_name:
11+
extension = self.view.file_name().split(".")[-1]
12+
else: # In blank view without file open
13+
extension = ""
914

1015
# Determine bracket type
1116
for c in settings.get("contexts"):

0 commit comments

Comments
 (0)