docstring selection(size_t sel_index)
{
return sel_index < theCuts.size()
- ? theCuts[sel_index].first.back().asString(AS_STR_INSETS)
+ ? theCuts[sel_index].first.back().asString(AS_STR_INSETS | AS_STR_NEWLINES)
: docstring();
}
cur.recordUndo();
DocIterator selbeg = cur.selectionBegin();
- // Get font setting before we cut
- Font const & font =
+ // Get font setting before we cut, we need a copy here, not a bare reference.
+ Font const font =
selbeg.paragraph().getFontSettings(cur.buffer().params(), selbeg.pos());
// Insert the new string