mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
Fix bug #6939 (Using math-insert to input math macros overwrites math expressions)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36216 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
ffc562bbe1
commit
1f6370dfd7
@ -1353,6 +1353,15 @@ void Cursor::niceInsert(MathAtom const & t)
|
||||
MathData ar(buffer());
|
||||
asArray(safe, ar);
|
||||
insert(ar);
|
||||
} else if (t->asMacro() && !safe.empty()) {
|
||||
MathData ar(buffer());
|
||||
asArray(safe, ar);
|
||||
docstring const name = t->asMacro()->name();
|
||||
MacroData const * data = buffer()->getMacro(name);
|
||||
if (data && data->numargs() - data->optionals() > 0) {
|
||||
plainInsert(MathAtom(new InsetMathBrace(ar)));
|
||||
posBackward();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user