code: def _lastColumn(self, block):
          
          text = block.text()
          index = len(block.text()) - 1
          while index >= 0 and \
                (text[index].isspace() or \
                 self._qpart.isComment(block.blockNumber(), index)):
              index -= 1
  
          return index
docs: Returns the last non-whitespace column in the given line.
          If there are only whitespaces in the line, the return value is -1.