def run(self, edit):
        try:
            text = sublime.get_clipboard()
            if text is not None and len(text) > 0:
                regions = []
                sel = self.view.sel()
                items = text.split("\n")
                if len(items) == 1: items = [text]
                strip = True
                for idx, region in enumerate(sel):
                    if idx < len(items):
                        row = items[idx].strip()
                        if region.empty():
                            sublime.status_message("empty")
                            row = self.view.substr(self.view.line(self.view.line(region).begin() - 1)) + "\n"
                            i = 0
                            if len(row.strip()): i = self.view.insert(edit, region.end(), row)
                            regions.append(sublime.Region(region.end() + i, region.end() + i))
                        else:
                            sublime.status_message("selection")
                            self.view.replace(edit, region, row)
                            i = len(row)
                            regions.append(sublime.Region(region.begin() + i, region.begin() + i))
                sel.clear()
                for region in regions:
                    sel.add(region)
                    pass
            else:
                sublime.status_message("No text found for Insert Text, canceled")
        except __HOLE__:
            sublime.status_message("Error while executing Insert Text, canceled")
            pass
dataset/ETHPy150Open duydao/Text-Pastry/text_pastry.py/TextPastryPasteCommand.run