Skip to content

Commit a333f74

Browse files
committed
Fix completion args to haxe via shell (thanks @KeyMaster-)
1 parent 51e1253 commit a333f74

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

flow.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22

3-
import sys, os, subprocess, shutil, json, codecs, time
3+
import sys, os, subprocess, shutil, shlex, json, codecs, time
44

55
import sublime, sublime_plugin
66
from .haxe_parse_completion_list import *
@@ -188,7 +188,7 @@ def show_errors(self, view, errs):
188188
return None
189189

190190
_pre = '<div class="invalid">&nbsp;Haxe Errors&nbsp;</div>'
191-
_css = 'div { margin:0.3em; } .flow-error-line { margin-left:1em; }'
191+
_css = 'div { margin:0.3em; } .flow-error-line { margin-left:1em; margin-right:2em; }'
192192
_res = ''
193193
for _err in errs:
194194
_res += '<div class="flow-error-line">'+_err+'</div>'
@@ -340,8 +340,11 @@ def get_targets(self):
340340

341341
def run_process( args ):
342342

343-
shell_cmd = " ".join(args)
344343
_proc = None
344+
shell_cmd = ""
345+
for arg in args:
346+
#make sure lines from the hxml file don't trip up the shell
347+
shell_cmd += shlex.quote(arg) + " "
345348

346349
if sys.platform == "win32":
347350
# Use shell=True on Windows, so shell_cmd is passed through with the correct escaping

0 commit comments

Comments
 (0)