// Previous paragraph, mark "carriage return" as
// deleted:
Paragraph & par = pars_[cur.pit() - 1];
- par.setChange(par.size(), Change::DELETED);
- setCursorIntern(cur, cur.pit() - 1, par.size());
- return false;
+ // Take care of a just inserted para break:
+ if (par.lookupChange(par.size()) != Change::INSERTED) {
+ par.setChange(par.size(), Change::DELETED);
+ setCursorIntern(cur, cur.pit() - 1, par.size());
+ return false;
+ }
}
needsUpdate = backspacePos0(cur);
}
}
- string text = layout->latexname().substr(0, 3);
- if (layout->latexname() == "theorem")
+ string name = layout->latexname();
+
+ // for captions, we want the abbreviation of the float type
+ if (layout->labeltype == LABEL_SENSITIVE) {
+ // Search for the first float or wrap inset in the iterator
+ size_t i = cur.depth();
+ while (i > 0) {
+ --i;
+ InsetBase * const in = &cur[i].inset();
+ if (in->lyxCode() == InsetBase::FLOAT_CODE
+ || in->lyxCode() == InsetBase::WRAP_CODE) {
+ name = in->getInsetName();
+ break;
+ }
+ }
+ }
+
+ string text = name.substr(0, 3);
+ if (name == "theorem")
text = "thm"; // Create a correct prefix for prettyref
text += ':';