docs: def on_state_changed(self, state):
          """
          Connects/Disconnects to the painted event of the editor
  
          :param state: Enable state
          """
          if state:
              self.editor.painted.connect(self._paint_margin)
              self.editor.repaint()
          else:
              self.editor.painted.disconnect(self._paint_margin)
              self.editor.repaint()