Created
August 25, 2016 19:56
-
-
Save alaingilbert/abc8ef9b4b30f4ef1cc23cb598dc07f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
import sublime | |
import sublime_plugin | |
import SublimeREPL.sublimerepl | |
import SublimeREPL.text_transfer | |
class RefreshNamespacesInReplCommand(SublimeREPL.text_transfer.ReplTransferCurrent): | |
def run(self, edit): | |
ns = re.sub("ns\s*", "", self.view.substr(self.view.find("ns\s*\S+",0))) | |
text = "(require '%s :reload)" % ns | |
self.view.window().run_command("repl_send", {"external_id": self.repl_external_id(), "text": text}) | |
text = "(curbside.api.runtime/stop!)" | |
self.view.window().run_command("repl_send", {"external_id": self.repl_external_id(), "text": text}) | |
text = "(curbside.api.runtime/start!)" | |
self.view.window().run_command("repl_send", {"external_id": self.repl_external_id(), "text": text}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Key bindings user: | |
{ "keys": ["alt+super+r"], "command": "refresh_namespaces_in_repl"}, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment