I am trying to create a command that will replace text on a line with new text (actually modified text from the current line). Here is the code that I am using:
#!/usr/bin/python import os
def texter(): oldtask = os.environ['TM_CURRENT_LINE'] # oldtask = "Alligator" newtask = "DONE " for i in range (len(oldtask)): if i > 4: newtask = newtask + oldtask[i] print newtask texter()
The problem that I have is that it inserts a line feed at the end of the new text. Is there a way to prevent that? Thanks.
Mike