Skip to content

Commit c417d48

Browse files
committed
fixed python_only decorator for Window- and TextCommands
1 parent 247d10a commit c417d48

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sublime_python.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,11 @@ def python_only(func):
392392
if num_args == 1:
393393
@wraps(func)
394394
def wrapper1(arg):
395-
if type(arg) == sublime.View:
395+
if isinstance(arg, sublime_plugin.WindowCommand):
396+
view = arg.window.active_view()
397+
elif isinstance(arg, sublime_plugin.TextCommand):
398+
view = arg.view
399+
elif type(arg) == sublime.View:
396400
view = arg
397401
elif type(arg) == sublime.Window:
398402
view = arg.active_view()

0 commit comments

Comments
 (0)