return;
string const paramName = "key";
+ UndoGroupHelper ugh(this);
InsetIterator it = inset_iterator_begin(inset());
for (; it; ++it) {
if (it->lyxCode() != CITE_CODE)
continue;
InsetCommand * inset = it->asInsetCommand();
docstring const oldValue = inset->getParam(paramName);
- if (oldValue == from)
+ if (oldValue == from) {
+ undo().recordUndo(CursorData(it));
inset->setParam(paramName, to);
+ }
}
}
mutable UserMacroSet usermacros;
/// Replace the inset contents for insets which InsetCode is equal
- /// to the passed \p inset_code.
+ /// to the passed \p inset_code. Handles undo.
void changeRefsIfUnique(docstring const & from, docstring const & to);
/// get source code (latex/docbook) for some paragraphs, or all paragraphs
setParam("literal", p["literal"]);
if (p["key"] != old_key) {
- cur.recordUndoFullBuffer();
+ // changeRefsIfUnique handles undo
cur.bv().buffer().changeRefsIfUnique(old_key, p["key"]);
updateCommand(p["key"]);
cur.forceBufferUpdate();