Fix path for the fl0w Sublime-settings file.
Also, some minor cleanups.
This commit is contained in:
parent
edd404beef
commit
dce28928cc
1 changed files with 23 additions and 24 deletions
|
@ -31,9 +31,8 @@ CHANNEL = "s"
|
||||||
|
|
||||||
def plugin_unloaded():
|
def plugin_unloaded():
|
||||||
for window in windows:
|
for window in windows:
|
||||||
if hasattr(window, "fl0w"):
|
if hasattr(window, "fl0w") and window.fl0w.connected:
|
||||||
if window.fl0w.connected:
|
window.fl0w.invoke_disconnect()
|
||||||
window.fl0w.invoke_disconnect()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -177,8 +176,8 @@ class Fl0w:
|
||||||
self.s_sync.start()
|
self.s_sync.start()
|
||||||
self.connected = True
|
self.connected = True
|
||||||
# Saving last server address
|
# Saving last server address
|
||||||
sublime.load_settings("fl0w.sublime-setting").set("server_address", connect_details_raw)
|
sublime.load_settings("fl0w.sublime-settings").set("server_address", connect_details_raw)
|
||||||
sublime.save_settings("fl0w.sublime-setting")
|
sublime.save_settings("fl0w.sublime-settings")
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
sublime.error_message("Error during connection creation:\n %s" % str(e))
|
sublime.error_message("Error during connection creation:\n %s" % str(e))
|
||||||
else:
|
else:
|
||||||
|
@ -187,7 +186,7 @@ class Fl0w:
|
||||||
|
|
||||||
# Input invokers
|
# Input invokers
|
||||||
def invoke_connect(self):
|
def invoke_connect(self):
|
||||||
address = sublime.load_settings("fl0w.sublime-setting").get("server_address")
|
address = sublime.load_settings("fl0w.sublime-settings").get("server_address")
|
||||||
address = "" if type(address) is not str else address
|
address = "" if type(address) is not str else address
|
||||||
Input("Address:Port", initial_text=address, on_done=self.connect).invoke(self.window)
|
Input("Address:Port", initial_text=address, on_done=self.connect).invoke(self.window)
|
||||||
|
|
||||||
|
@ -255,8 +254,8 @@ class Fl0w:
|
||||||
def set_debug(self, debug):
|
def set_debug(self, debug):
|
||||||
sublime.status_message("fl0w: Debug now '%s'" % debug)
|
sublime.status_message("fl0w: Debug now '%s'" % debug)
|
||||||
self.sock.debug = debug
|
self.sock.debug = debug
|
||||||
sublime.load_settings("fl0w.sublime-setting").set("debug", debug)
|
sublime.load_settings("fl0w.sublime-settings").set("debug", debug)
|
||||||
sublime.save_settings("fl0w.sublime-setting")
|
sublime.save_settings("fl0w.sublime-settings")
|
||||||
|
|
||||||
|
|
||||||
class Fl0wCommand(sublime_plugin.WindowCommand):
|
class Fl0wCommand(sublime_plugin.WindowCommand):
|
||||||
|
@ -276,8 +275,8 @@ class Fl0wCommand(sublime_plugin.WindowCommand):
|
||||||
if not ".no-fl0w" in files:
|
if not ".no-fl0w" in files:
|
||||||
if not ".fl0w" in files:
|
if not ".fl0w" in files:
|
||||||
if sublime.ok_cancel_dialog("""We've detected that this is your first time using fl0w in your current directory.
|
if sublime.ok_cancel_dialog("""We've detected that this is your first time using fl0w in your current directory.
|
||||||
We don't want to be responsible for any lost work so please backup your files before proceding.
|
We don't want to be responsible for any lost work so please backup your files before proceding.
|
||||||
(An empty project directory is recommended but not necessary.)""", "Yes"):
|
(An empty project directory is recommended but not necessary.)""", "Yes"):
|
||||||
open(folder + "/.fl0w", 'a').close()
|
open(folder + "/.fl0w", 'a').close()
|
||||||
self.window.fl0w = Fl0w(self.window)
|
self.window.fl0w = Fl0w(self.window)
|
||||||
windows.append(self.window)
|
windows.append(self.window)
|
||||||
|
|
Reference in a new issue