

def colorize(self, _edit, _delayed=True):
    _region = sublime.Region(0, self.view.size())
    content = self.view.substr(_region)
    todos = []
    regionsOpenPre = []
    regionsOpen = []
    regionsProgressPre = []
    regionsProgress = []
    regionsInconsistentPre = []
    regionsInconsistent = []
    for cTodo in RE_TODO_OLD.finditer(content):
        regionTodo = sublime.Region(cTodo.end('prefix'), cTodo.end('comment'))
        regionsInconsistent.append(regionTodo)
    for cTodo in RE_TODO_EXISTING.finditer(content):
        regionMark = sublime.Region(cTodo.end('prefix'), cTodo.start('state'))
        regionTodo = sublime.Region(cTodo.start('state'), cTodo.end('comment'))
        if (not self.todoValidate(cTodo.group('id'), cTodo.group('state'), cTodo.group('tags'), cTodo.group('priority'), cTodo.group('comment'))):
            regionsInconsistentPre.append(regionMark)
            regionsInconsistent.append(regionTodo)
            continue
        if (cTodo.group('state') == '='):
            regionsProgressPre.append(regionMark)
            regionsProgress.append(regionTodo)
        else:
            regionsOpenPre.append(regionMark)
            regionsOpen.append(regionTodo)
    _delayed = int(_delayed)
    self.view.add_regions('dopletOpenPre', regionsOpenPre, 'comment', 'dot')
    self.view.add_regions('dopletOpen', regionsOpen, 'comment', 'dot', self.codeColor)
    sublime.set_timeout((lambda : self.view.add_regions('dopletProgressPre', regionsProgressPre, 'constant.language', 'dot')), (150 * _delayed))
    sublime.set_timeout((lambda : self.view.add_regions('dopletProgress', regionsProgress, 'constant.language', 'dot', self.codeColor)), (150 * _delayed))
    sublime.set_timeout((lambda : self.view.add_regions('dopletInconsistentPre', regionsInconsistentPre, 'invalid', 'dot')), (300 * _delayed))
    sublime.set_timeout((lambda : self.view.add_regions('dopletInconsistent', regionsInconsistent, 'invalid', 'dot', self.codeColor)), (300 * _delayed))

dataset/ETHPy150Open NikolayRag/typeTodo/commands_maintain.py TypetodoMaintainCommand.colorize/original