code: def run_reporter(self):
          " Buffer text changed. "
          if not self._reporter_is_running:
              self._reporter_is_running = True
  
              text = self.buffer.text
              self.report_errors = []
  
              # Don't run reporter when we don't have a location. (We need to
              # know the filetype, actually.)
              if self.location is None:
                  return
  
              # Better not to access the document in an executor.
              document = self.buffer.document
  
              def in_executor():
                  # Call reporter
                  report_errors = report(self.location, document)
  
                  def ready():
                      self._reporter_is_running = False
  
                      # If the text has not been changed yet in the meantime, set
                      # reporter errors. (We were running in another thread.)
                      if text == self.buffer.text:
                          self.report_errors = report_errors
                          get_app().invalidate()
                      else:
                          # Restart reporter when the text was changed.
                          self.run_reporter()
  
                  call_from_executor(ready)
              run_in_executor(in_executorf run_reporter(self):
          " Buffer text changed. "
          if not self._reporter_is_running:
              self._reporter_is_running = True
  
              text = self.buffer.text
              self.report_errors = []
  
              # Don't run reporter when we don't have a location. (We need to
              # know the filetype, actually.)
              if self.location is None:
                  return
  
              # Better not to access the document in an executor.
              document = self.buffer.document
  
              def in_executor():
                  # Call reporter
                  report_errors = report(self.location, document)
  
                  def ready():
                      self._reporter_is_running = False
  
                      # If the text has not been changed yet in the meantime, set
                      # reporter errors. (We were running in another thread.)
                      if text == self.buffer.text:
                          self.report_errors = report_errors
                          get_app().invalidate()
                      else:
                          # Restart reporter when the text was changed.
                          self.run_reporter()
  
                  call_from_executor(ready)
              run_in_executor(in_executor)
docs: Buffer text changed.