Could you help me with my first plugin? I have a file that is delimited by tilde's "~". I would like to insert a new line after the tilde character. I would also like to insert a new line before the string of characters "INS*". I gave it a first stab, I had written some python years ago, by following the ROT13 example on the website. This is what I cam up with:
import sublime, sublime_plugin
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*')
When I run it in the console I don't get any output:
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!