Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions exec.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def __init__(self, cmd, shell_cmd, env, listener,
# "path" is an opt`ion in build systems
path="",
# "shell" is an options in build systems
shell=False):
shell=False, *args, **kwargs):

if not shell_cmd and not cmd:
raise ValueError("shell_cmd or cmd is required")
Expand Down Expand Up @@ -140,7 +140,7 @@ class ExecCommand(sublime_plugin.WindowCommand, ProcessListener):
errs_by_file = {}
phantom_sets_by_buffer = {}
show_errors_inline = True

def run(self, cmd = None, shell_cmd = None, file_regex = "", line_regex = "", working_dir = "",
encoding = "utf-8", env = {}, quiet = False, kill = False,
update_phantoms_only=False, hide_phantoms_only=False,
Expand Down Expand Up @@ -195,7 +195,7 @@ def run(self, cmd = None, shell_cmd = None, file_regex = "", line_regex = "", wo
merged_env = env.copy()
self.encoding = encoding
self.quiet = quiet

# Call create_output_panel a second time after assigning the above
# settings, so that it'll be picked up as a result buffer

Expand All @@ -216,10 +216,11 @@ def fun(self, cmd, shell_cmd, merged_env, ss):
# self.window.create_output_panel("exec")
# print("THIis" + str(ss))
history.insert(ss)
if shell_cmd:
shell_cmd += " " + str(ss)
else:
cmd.append(str(ss))
for s in str(ss).split():
if shell_cmd:
shell_cmd += " " + s
elif str(ss):
cmd.append(s)


self.debug_text = ""
Expand Down Expand Up @@ -256,9 +257,9 @@ def fun(self, cmd, shell_cmd, merged_env, ss):

try:
# Forward kwargs to AsyncProcess
self.proc = AsyncProcess(cmd, shell_cmd, merged_env, self, self.sl)

self.proc = AsyncProcess(cmd, shell_cmd, merged_env, self, **self.sl)

self.text_queue_lock.acquire()
try:
self.text_queue_proc = self.proc
Expand All @@ -270,7 +271,7 @@ def fun(self, cmd, shell_cmd, merged_env, ss):
self.append_string(None, self.debug_text + "\n")
if not self.quiet:
self.append_string(None, "[Finished]")


def is_enabled(self, kill = False):
if kill:
Expand Down Expand Up @@ -454,4 +455,4 @@ def hide_phantoms(self):
self.show_errors_inline = False

def on_phantom_navigate(self, url):
self.hide_phantoms()
self.hide_phantoms()