}
-void Cursor::niceInsert(docstring const & t, Parse::flags f, bool enter)
+int Cursor::niceInsert(docstring const & t, Parse::flags f, bool enter)
{
MathData ar(buffer());
asArray(t, ar, f);
- if (ar.size() == 1 && (enter || selection()))
+ if (ar.size() == 1 && (enter || selection())) {
niceInsert(ar[0]);
- else
+ return 1;
+ } else {
insert(ar);
+ return ar.size();
+ }
}
void plainInsert(MathAtom const & at);
///
void niceInsert(MathAtom const & at);
- ///
- void niceInsert(docstring const & str, Parse::flags f = Parse::NORMAL,
+ /// return the number of inserted array items
+ int niceInsert(docstring const & str, Parse::flags f = Parse::NORMAL,
bool enter = true);
/// in pixels from top of screen