mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
* src/text3.C (doDispatch):
- add missing undo call to LFUN_QUOTE_INSERT (fixes bug 3439). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17764 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e6dd941880
commit
1390d4cf2c
28
src/text3.C
28
src/text3.C
@ -585,6 +585,8 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
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);
|
||||
@ -948,22 +950,25 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
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,
|
||||
@ -1255,7 +1260,6 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
InsetBase * inset = createInset(&cur.bv(), cmd);
|
||||
if (!inset)
|
||||
break;
|
||||
|
||||
recordUndo(cur);
|
||||
cur.clearSelection();
|
||||
insertInset(cur, inset);
|
||||
|
Loading…
Reference in New Issue
Block a user