Restore correct left/right navigation in root inset

Now all cells are correctly visited in sequence when moving with
cursor left/right.
This commit is contained in:
Enrico Forestieri 2018-11-10 14:55:00 +01:00
parent 93db2bd08e
commit 77234fecd8
2 changed files with 22 additions and 0 deletions

View File

@ -180,6 +180,24 @@ bool InsetMathRoot::idxBackward(Cursor & cur) const
} }
bool InsetMathRoot::idxFirst(Cursor & cur) const
{
LASSERT(&cur.inset() == this, return false);
cur.idx() = 1;
cur.pos() = 0;
return true;
}
bool InsetMathRoot::idxLast(Cursor & cur) const
{
LASSERT(&cur.inset() == this, return false);
cur.idx() = 0;
cur.pos() = cur.lastpos();
return true;
}
void InsetMathRoot::maple(MapleStream & os) const void InsetMathRoot::maple(MapleStream & os) const
{ {
os << '(' << cell(0) << ")^(1/(" << cell(1) <<"))"; os << '(' << cell(0) << ")^(1/(" << cell(1) <<"))";

View File

@ -30,6 +30,10 @@ public:
bool idxForward(Cursor & cur) const; bool idxForward(Cursor & cur) const;
/// ///
bool idxBackward(Cursor & cur) const; bool idxBackward(Cursor & cur) const;
///
bool idxFirst(Cursor &) const;
///
bool idxLast(Cursor &) const;
/// ///
void metrics(MetricsInfo & mi, Dimension & dim) const; void metrics(MetricsInfo & mi, Dimension & dim) const;