diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 2a380a74fa..7bff3d7c6e 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -95,12 +95,9 @@ void InsetLabel::updateLabelAndRefs(docstring const & new_label, if (label == old_label) return; - if (!cursor) - return; - - cursor->recordUndo(); buffer().undo().beginUndoGroup(); - buffer().markDirty(); + if (cursor) + cursor->recordUndo(); setParam("name", label); updateReferences(old_label, label); buffer().undo().endUndoGroup(); diff --git a/src/insets/InsetLabel.h b/src/insets/InsetLabel.h index 35edecf567..61bcc1f310 100644 --- a/src/insets/InsetLabel.h +++ b/src/insets/InsetLabel.h @@ -33,8 +33,8 @@ public: docstring const & prettyCounter() const { return pretty_counter_; } /// Updates only the label string, doesn't handle undo nor references. void updateLabel(docstring const & new_label); - /// Updates the label. Will handle undo/redo as well as update the - /// references to this label if \p cursor is passed. + /// Updates the label and the references to it. + /// Will also handle undo/redo if \p cursor is passed. void updateLabelAndRefs(docstring const & new_label, Cursor * cursor = 0); /// \name Public functions inherited from Inset class