SublimeREPL
SublimeREPL copied to clipboard
Possible to send a line without indentation
When debugging a few lines of python code within a loop using SublimeREPL, it is necessary to unindent the code before sending the lines to sublimeREPL, otherwise the interpreter raises IndentationError. It would be nice if removal of the extraneous indentation were automatic, configurable, or another shortcut.
+1 this makes it useless actually for me
After navigating the web I ended up here wondering if anyone has ever solved this issue. It will be fantastic to send chunks of code within a function.
This is a reason why sometimes I end up using SendText and working in the terminal.
Any news on solving this issue?
Thanks!!
+1
Anyone have solution for mac? Thank you very much!
Found a solution! https://gist.github.com/ultinomics/46c40275a93bab74cff6.
I used the solution suggested by tbenst above, but I also did modify my sublimeREPL to delete the extra spaces/indentation. It is not perfect but it worked for me.
In the text_transfer.py file I modified selected_lines
def selected_lines(self):
v = self.view
parts = []
first_line = v.substr(v.lines(v.sel()[0])[0])
empty_spaces = 0
while first_line[empty_spaces] == " ":
empty_spaces += 1
for sel in v.sel():
for line in v.lines(sel):
parts.append(v.substr(line)[empty_spaces:])
return "\n".join(parts)