- Code: Select all
import sublime, sublime_plugin
class X12Command(sublime_plugin.TextCommand):
def run(self, view, args):
for region in view.sel():
if not region.empty():
s = view.substr(region)
s = s.replace('~', '~\n')
s = s.replace('INS*', '\nINS*')
view.replace(region, s)
When I run it in the console I don't get any output:
>>> view.run_command('X12')
But there are no errors. The text in the editor window does not update and there is no other feedback. I tried dropping a print statement in the run method but it didn't write to the command window like I thought it would.
Any help is appreciated. Thanks!