'Overrides paint event to update the list of visible blocks'

def paintEvent(self, event):

    self.update_visible_blocks(event)
    TextEditBaseWidget.paintEvent(self, event)
    self.painted.emit(event)
