Fixup 097da3a9: fix horizontal navigatiion in InsetMathRoot

Exchanging cells 0 and 1 requires to implement idxBackWard/Forward.
This commit is contained in:
Jean-Marc Lasgouttes 2018-11-07 11:53:00 -10:00
parent 974766cd1c
commit 2daf493cbc
2 changed files with 28 additions and 0 deletions

View File

@ -156,6 +156,30 @@ bool InsetMathRoot::idxUpDown(Cursor & cur, bool up) const
}
bool InsetMathRoot::idxForward(Cursor & cur) const
{
// nucleus is 0 and is on the right
if (cur.idx() == 0)
return false;
else
cur.idx() = 0;
return true;
}
bool InsetMathRoot::idxBackward(Cursor & cur) const
{
// nucleus is 0 and is on the right
if (cur.idx() == 1)
return false;
else
cur.idx() = 1;
return true;
}
void InsetMathRoot::maple(MapleStream & os) const
{
os << '(' << cell(0) << ")^(1/(" << cell(1) <<"))";

View File

@ -26,6 +26,10 @@ public:
InsetMathRoot(Buffer * buf);
///
bool idxUpDown(Cursor & cur, bool up) const;
///
bool idxForward(Cursor & cur) const;
///
bool idxBackward(Cursor & cur) const;
///
void metrics(MetricsInfo & mi, Dimension & dim) const;