Skip to content

Commit

Permalink
fixed windows issues
Browse files Browse the repository at this point in the history
  • Loading branch information
digital-phoenix authored and olegklimov committed Mar 3, 2024
1 parent 8071dc0 commit da719fb
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Default.sublime-keymap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[
{ "keys": ["tab"], "command": "refact_accept_completion", "context": [{"key": "refact.show_completion"}] },
{ "keys": ["escape"], "command": "refact_clear_completion", "context": [{"key": "refact.show_completion"}] },
{ "keys": ["ctrl+p"], "command": "refact_pause" }
{ "keys": ["ctrl+alt+p"], "command": "refact_pause" }
]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Refact for VS Code is a free, open-source AI code assistant
6. Open refact.sublime-settings and add the API key

#Pause
You can pause and unpause refact suggestions by pressing ctrl + p
You can pause and unpause refact suggestions by pressing ctrl + alt + p

#File Documentation#

Expand Down
4 changes: 3 additions & 1 deletion src/refact_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ def get_server_commands(self):
def start_server(self):
self.active = True
server_cmds = self.get_server_commands()
self.process = subprocess.Popen(server_cmds, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr=subprocess.PIPE, shell=False)
startupinfo = subprocess.STARTUPINFO()
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
self.process = subprocess.Popen(server_cmds, startupinfo=startupinfo, stdin = subprocess.PIPE, stdout = subprocess.PIPE, stderr=subprocess.PIPE, shell=False)

self.statusbar.update_statusbar("ok")
if not self.connection is None:
Expand Down
4 changes: 2 additions & 2 deletions src/refact_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def __init__(self, view, connection, is_ui = False):
self.file_name = view.file_name()
if view.file_name() is None:
if is_ui:
self.file_name = "/UI"
self.file_name = os.path.abspath(os.sep) + "UI"
else:
self.file_name = "/" + str(time.time()) + "_" + str(view.id())
self.file_name = os.path.abspath(os.sep) + str(time.time()) + "_" + str(view.id())

self.phantom_state = PhantomState(view)
self.connection = connection
Expand Down
7 changes: 5 additions & 2 deletions src/statusbar.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def update_statusbar(self, status, msg = ""):
self.status_loop()

def handle_err(self, err):
if not isinstance(err, str) and err.message:
err = err.message
if not isinstance(err, str):
if hasattr(err, 'message'):
err = err.message
else:
err = str(err)
self.update_statusbar("error", msg = str(err))

0 comments on commit da719fb

Please sign in to comment.