Here is the code I have so far:
- Code: Select all
def run(self, edit):
# Get a reference to the selections
sel = self.view.sel()
# Loop over the various selections
for region in self.view.sel():
# grab full lines regardless of where they start in the line
line2 = self.view.line(region)
# split them into individual lines
lines = self.view.split_by_newlines(line2)
for l in lines:
# return the contents as a string
s = self.view.substr(l)
Where the print statement is, I would like to replace the entire line. Loop and repeat. Not all lines would be changed or replaced.
Thanks for any help or direction.