mattiasnordin / StataEditor

Stata Editor for Sublime Text 3
47 stars 18 forks source link

two windows poped up #24

Open shuai-zhou opened 6 years ago

shuai-zhou commented 6 years ago

I am using Sublime and STATA. When I code in Sublime and press ctrl+d, there popped up two STATA windows. One is no results, I mean the code from Sublime did not go to STATA, the other window shows the results, which means that code was transferred from Sublime to STATA. Did anybody has the same problem? How to fix it?

By the way, the two windows' name are "2-Stata/SE 15.0" and "Stata/SE 15.0"

mattiasnordin commented 6 years ago

See my response to issue #23. This seems to be something that happens with Stata 15 and I have not been able to resolve the issue yet since I don't have access to Stata 15 at the moment. Maybe you could try changing the path settings as suggested in that issue.

shuai-zhou commented 6 years ago

Thanks. Can you explain shortly what is that path for? I am not majored in CS, but I can tell that something was not right during the code transfer, because sublime will have "no response" for quite a short time, like ten+ seconds.

mattiasnordin commented 6 years ago

Sorry for the late response. The path in this case is the directory which Sublime Text will send to Stata as the path for Stata (i.e., the "cd" command in Stata). I think it's unlikely that this is somehow causing the problem, but I thought it could be worth a shot to try and change it. Have you looked at what error message you get from Sublime Text when starting Stata? Is it the same as the one in issue #23?

shuai-zhou commented 6 years ago

@mattiasnordin there are no errors, the problem I encountered is kind of the same as #23

mattiasnordin commented 6 years ago

Have you opened the console? There should be some error message displayed there.

shuai-zhou commented 6 years ago

@mattiasnordin Traceback (most recent call last): File "D:\Green Software\Sublime Text\sublime_plugin.py", line 812, in run_ return self.run(edit, **args) File "StataEditorPlugin in D:\Green Software\Sublime Text\Data\Installed Packages\StataEditor.sublime-package", line 154, in run File "StataEditorPlugin in D:\Green Software\Sublime Text\Data\Installed Packages\StataEditor.sublime-package", line 68, in StataAutomate File "<COMObject stata.StataOLEApp>", line 2, in DoCommand pywintypes.com_error: (-2147417851, 'The server threw an exception.', None, None)

mattiasnordin commented 6 years ago

Thanks! No luck there I'm afraid. Unfortunately, I cannot do anything more until I get access to Stata 15 myself. If there's anyone who uses Stata 15 who has found a way to fix this problem (or for whom it works anyway), please let me know!

mattiasnordin commented 6 years ago

I have now tried to fix this issue with version 0.9.0. Please let me know if it works for you.

2sls commented 4 years ago

I think this is still an issue - both in Stata 15 and also 16. It creates two windows - the commands are sent to the first window and the second one is just idle and need to be closed manually

EDIT: Just changed the waiting time parameter from 0.5 to 1 second and now the issue is gone.