From 8314b93c0478f9e568f159860ce786f77fc74bd8 Mon Sep 17 00:00:00 2001 From: Stefan Schimanski Date: Sat, 6 Sep 2008 15:10:23 +0000 Subject: [PATCH] * enter new macro template and select the name. This save a lot of keystrokes to remoe the long default name. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26315 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Text3.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Text3.cpp b/src/Text3.cpp index 729ce59b62..009077c342 100644 --- a/src/Text3.cpp +++ b/src/Text3.cpp @@ -1481,8 +1481,16 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) MacroType type = MacroTypeNewcommand; if (s2 == "def") type = MacroTypeDef; - cur.insert(new MathMacroTemplate(from_utf8(token(s, ' ', 0)), nargs, false, type)); - //cur.nextInset()->edit(cur, true); + MathMacroTemplate * inset = new MathMacroTemplate(from_utf8(token(s, ' ', 0)), nargs, false, type); + inset->setBuffer(bv->buffer()); + insertInset(cur, inset); + + // enter macro inset and select the name + cur.push(*inset); + cur.top().pos() = cur.top().lastpos(); + cur.resetAnchor(); + cur.selection() = true; + cur.top().pos() = 0; } break;