* 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
This commit is contained in:
Stefan Schimanski 2008-09-06 15:10:23 +00:00
parent 849b405c73
commit 8314b93c04

View File

@ -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;