SublimeClojureSetup
SublimeClojureSetup copied to clipboard
Update ClojureHelpers.py
SublimeREPL has updated their namespaces for python 3.
Can also update the readme, as with these changes it works for Sublime Text 3.
I also think LoadFileInReplCommand should switch the ns to that of the loaded file, or at least there should be a keybind to do so.
I haven't included it, but it is simple:
class LoadFileInReplCommand(text_transfer.ReplTransferCurrent):
def run(self, edit):
form = "(load-file \"" + self.view.file_name() +"\")"
self.view.window().run_command("run_command_in_repl", {"command": form})
## Switch to the namespace of the current file
ns = re.sub("ns\s*", "", self.view.substr(self.view.find("ns\s*\S+",0)))
form2 = "(in-ns '" + ns + ")"
self.view.window().run_command("run_command_in_repl", {"command": form2})