-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd popup on Sublime Text WIndows 10 + WSL #42
Comments
thank you my friend for posting this |
hi, thx for support again. i got this is line 33: |
@girng Looks like you should use |
thank you, @faustinoaq did that. got rid of the pipe error, now still get:
line 38: |
@girng Try |
@faustinoaq ty again sir.. sorry for all this trouble.. lol that error went away, but now getting:
|
top part of def run:
|
@girng no problem 😅 Try this: def run(self, edit):
vsize = self.view.size()
region = sublime.Region(0, vsize)
src = self.view.substr(region)
window = self.view.window()
settings = sublime.load_settings('Crystal.sublime-settings')
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
pipe = open(os.devnull, 'w')
# Prevent flashing windows if used from a GUI application
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
cmd = [settings.get("crystal_cmd"), "tool", "format", "-", "--format", "json"]
proc = subprocess.call(cmd, stdout = pipe, stderr = pipe,startupinfo = startupinfo)
proc.stdin.write(bytes(src, 'UTF-8'))
proc.stdin.close()
output = proc.stdout.read().decode('UTF-8')
exit = proc.wait()
pos = 0
# more code... or this: def run(self, edit):
vsize = self.view.size()
region = sublime.Region(0, vsize)
src = self.view.substr(region)
window = self.view.window()
settings = sublime.load_settings('Crystal.sublime-settings')
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
pipe = open(os.devnull, 'w')
# Prevent flashing windows if used from a GUI application
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
cmd = [settings.get("crystal_cmd"), "tool", "format", "-", "--format", "json"]
with subprocess.call(cmd, stdout = pipe, stderr = pipe,startupinfo = startupinfo) as proc:
proc.stdin.write(bytes(src, 'UTF-8'))
proc.stdin.close()
output = proc.stdout.read().decode('UTF-8')
exit = proc.wait()
pos = 0
# more code... |
ty for continuing to help. this is painful xD first code u supplied, i get:
2nd code u supplied, i get:
line 38: |
What a mess... |
@oprypin Thank you! 😅 |
File "crystal_format in C:\Users\Administrator\AppData\Roaming\Sublime Text 3\Installed Packages\Crystal.sublime-package", line 45, in run line 45: |
ok, so i commented out the if exit == 0 block (got rid of that error). however, it still doesn't format the code :( sorry for all the trouble, im just trying reporting back if errors are found |
ok. got it working
i basically just removed the |
WARNINGDO NOT REMOVE that if exit == 0 I just saved, and randomly almost LOST my entire LoginHandler.cr file (it replaced my file with blank text). Doing a back up right now and going back to the original crystal_format.py with the cmd pop up for now. Not risking anything atm sorry |
@girng No problem, keep trying, Thank you for be aware of this issue 👍 |
Praise to you and opryprin for help. just need solution for |
Needs |
This issue was discovered by @girng
Solution proposed by @oprypin :
sublime-crystal/crystal_format.py
Line 30 in d4abc5a
https://github.com/coin-or/pulp/blob/bac6d9d2214ba773d638d2de5149940cfd711359/src/pulp/solvers.py#L378-L382
The text was updated successfully, but these errors were encountered: