SublimeClojureSetup icon indicating copy to clipboard operation
SublimeClojureSetup copied to clipboard

Update ClojureHelpers.py

Open laconiccrafts opened this issue 6 years ago • 2 comments

SublimeREPL has updated their namespaces for python 3.

laconiccrafts avatar Aug 12 '19 20:08 laconiccrafts

Can also update the readme, as with these changes it works for Sublime Text 3.

laconiccrafts avatar Aug 12 '19 20:08 laconiccrafts

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})

laconiccrafts avatar Aug 12 '19 22:08 laconiccrafts