#include "mathed/math_data.h"
#include "mathed/math_inset.h"
+#include "mathed/math_scriptinset.h"
#include "mathed/math_macrotable.h"
#include "support/limited_stack.h"
for (int i = 0; ; ++i) {
int xo;
int yo;
- it.inset().cursorPos(it.top(), c.boundary(), xo, yo);
+ it.inset().cursorPos(it.top(), c.boundary() && ((i+1) == it.depth()), xo, yo);
double d = (x - xo) * (x - xo) + (y - yo) * (y - yo);
// '<=' in order to take the last possible position
// this is important for clicking behind \sum in e.g. '\sum_i a'
MathScriptInset const * p = prevAtom()->asScriptInset();
if (p && p->has(up)) {
--pos();
- push(inset());
- idx() = up; // the superscript has index 1
+ push(*const_cast<MathScriptInset*>(p));
+ idx() = p->idxOfScript(up);
pos() = lastpos();
- //lyxerr << "updown: handled by scriptinset to the left" << endl;
return true;
}
}
if (pos() != lastpos()) {
MathScriptInset const * p = nextAtom()->asScriptInset();
if (p && p->has(up)) {
- push(inset());
- idx() = up;
+ push(*const_cast<MathScriptInset*>(p));
+ idx() = p->idxOfScript(up);
pos() = 0;
- //lyxerr << "updown: handled by scriptinset to the right" << endl;
return true;
}
}