code: def update_rectangle(self, rectangle, scroll_y):
          
  
          if scroll_y:
              self.scroll(0, scroll_y)
          else:
              self.update(0, rectangle.y(), self.width(), rectangle.height())
  
          if rectangle.contains(self.__editor.viewport().rect()):
              self.set_editor_viewport_margins(0)
          return True
docs: Updates the given Widget rectangle.
  
          :param rectangle: Rectangle to update.
          :type rectangle: QRect
          :param scroll_y: Amount of pixels the viewport was scrolled.
          :type scroll_y: int
          :return: Method success.
          :rtype: bool