case LFUN_BREAK_LINE: {
// Not allowed by LaTeX (labels or empty par)
if (cur.pos() > cur.paragraph().beginOfBody()) {
+ // this avoids a double undo
+ // FIXME: should not be needed, ideally
if (!cur.selection())
recordUndo(cur);
cap::replaceSelection(cur);
}
case LFUN_QUOTE_INSERT: {
- cap::replaceSelection(cur);
Paragraph & par = cur.paragraph();
pos_type pos = cur.pos();
- char_type c;
- if (pos == 0)
- c = ' ';
- else if (cur.prevInset() && cur.prevInset()->isSpace())
- c = ' ';
- else
- c = par.getChar(pos - 1);
-
- LyXLayout_ptr const & style = par.layout();
-
BufferParams const & bufparams = bv->buffer()->params();
+ LyXLayout_ptr const & style = par.layout();
if (!style->pass_thru
&& par.getFontSettings(bufparams, pos).language()->lang() != "hebrew") {
+ // this avoids a double undo
+ // FIXME: should not be needed, ideally
+ if (!cur.selection())
+ recordUndo(cur);
+ cap::replaceSelection(cur);
+ pos = cur.pos();
+ char_type c;
+ if (pos == 0)
+ c = ' ';
+ else if (cur.prevInset() && cur.prevInset()->isSpace())
+ c = ' ';
+ else
+ c = par.getChar(pos - 1);
string arg = to_utf8(cmd.argument());
if (arg == "single")
cur.insert(new InsetQuotes(c,
InsetBase * inset = createInset(&cur.bv(), cmd);
if (!inset)
break;
-
recordUndo(cur);
cur.clearSelection();
insertInset(cur, inset);