def store_state(self, state=None, action=None):
        """Store the current editor state for undo/redo."""
        if state is None:
            state = State()
            state.store(self)
        if len(self.history) > 1:
            if self.current_state < len(self.history)-1:
                self.history = self.history[:self.current_state]

        self.history.append(state)
        self.current_state = len(self.history)-1

        if len(self.history) > self.config["max_history"]:
            self.history.pop(0)
dataset/ETHPy150Open richrd/suplemon/suplemon/editor.py/Editor.store_state/original