'Parses the complete text and stores format for each character.'

def make_charlist(self):

    def worker_output(worker, output, error):
        'Worker    finished    callback.'
        self._charlist = output
        if ((error is None) and output):
            self._allow_highlight = True
            self.rehighlight()
        self._allow_highlight = False
    text = to_text_string(self.document().toPlainText())
    tokens = self._lexer.get_tokens(text)
    self._worker_manager.terminate_all()
    worker = self._worker_manager.create_python_worker(self._make_charlist, tokens, self._tokmap, self.formats)
    worker.sig_finished.connect(worker_output)
    worker.start()
