wuub/SublimeREPL — Issue #4: Send code to REPL by the paragraph
Author: sandover
Created: 2012-01-25 19:25:20+00:00
State: open

As I mentioned on the Sublime Text forums, this would be very useful in a lot of contexts, particularly (for me) in Clojure. The patch is so small I'll just provide it here:

in text_transfer.py, in class ReplTransferCurrent, add this method:

# Ignores multi-selection; grabs the first selection or cursor position
def current_paragraph(self):
v = self.view
for s in v.sel():
return v.substr(paragraph.expand_to_paragraph(v, s.begin()))

Within the run method, add this clause:

elif scope == "paragraph":
text = self.current_paragraph()

And add a keymap so it's usable.