code: def selections(self):
          
          selections = []
          cursors = self.cursors()
          if cursors:
              background = self._qpart.palette().color(QPalette.Highlight)
              foreground = self._qpart.palette().color(QPalette.HighlightedText)
              for cursor in cursors:
                  selection = QTextEdit.ExtraSelection()
                  selection.format.setBackground(background)
                  selection.format.setForeground(foreground)
                  selection.cursor = cursor
  
                  selections.append(selection)
  
          return selections
docs: Build list of extra selections for rectangular selection