// inset.yo_, so getCursor() returns an old value.
// Ugly as you like.
}
- lyxerr << "#### LCursor::getPos: x: " << x << " y: " << y << endl;
+ //lyxerr << "#### LCursor::getPos: " << *this
+ // << " x: " << x << " y: " << y << endl;
}
<< idx() << ' ' << nargs()
<< " in: " << inset() << endl;
}
- idx() = min(idx(), nargs() - 1);
+ idx() = min(idx(), lastidx());
if (pos() > lastpos()) {
lyxerr << "this should not really happen - 2: "
idx() = up;
pos() = 0;
} else if (pos() != 0 && prevAtom()->asScriptInset()) {
- prevAtom().nucleus()->asScriptInset()->ensure(up);
- posLeft();
- push(inset());
+ --pos();
+ nextAtom().nucleus()->asScriptInset()->ensure(up);
+ push(nextInset());
idx() = up;
pos() = lastpos();
} else if (pos() != 0) {
--pos();
cell()[pos()] = MathAtom(new MathScriptInset(nextAtom(), up));
- push(inset());
+ push(nextInset());
idx() = up;
pos() = 0;
} else {
plainInsert(MathAtom(new MathScriptInset(up)));
- posLeft();
+ --pos();
nextAtom().nucleus()->asScriptInset()->ensure(up);
- push(inset());
+ push(nextInset());
idx() = up;
pos() = 0;
}
bool LCursor::interpret(char c)
{
- lyxerr << "interpret 2: '" << c << "'" << endl;
+ //lyxerr << "interpret 2: '" << c << "'" << endl;
clearTargetX();
if (inMacroArgMode()) {
posLeft();
void LyXFunc::processKeySym(LyXKeySymPtr keysym, key_modifier::state state)
{
- string argument;
-
- if (lyxerr.debugging(Debug::KEY)) {
- lyxerr << "KeySym is "
- << keysym->getSymbolName()
- << endl;
- }
+ lyxerr[Debug::KEY] << "KeySym is " << keysym->getSymbolName() << endl;
// Do nothing if we have nothing (JMarc)
if (!keysym->isOK()) {
if (encoded_last_key != 0) {
string arg;
arg += encoded_last_key;
+ lyxerr << "SelfInsert arg[`"
+ << arg << "']" << endl;
dispatch(FuncRequest(LFUN_SELFINSERT, arg));
- lyxerr[Debug::KEY] << "SelfInsert arg[`"
- << argument << "']" << endl;
+ lyxerr[Debug::KEY]
+ << "SelfInsert arg[`" << arg << "']" << endl;
}
} else {
dispatch(func);
const_iterator it = begin() + i;
if ((*it)->getChar() == ' ')
x += glue;
- lyxerr << "char: " << (*it)->getChar()
- << "width: " << (*it)->width() << std::endl;
+ //lyxerr << "char: " << (*it)->getChar()
+ // << "width: " << (*it)->width() << std::endl;
x += (*it)->width();
}
return x;
// move cursor visually into empty cells ("blue rectangles");
if (cur.cell().empty())
x += 2;
- lyxerr << "MathNestInset::getCursorPos: cur: " << cur
- << " x: " << x << " y: " << y << endl;
- BOOST_ASSERT(x < 100000);
}
bool MathNestInset::idxNext(LCursor & cur) const
{
BOOST_ASSERT(cur.inset() == this);
- if (cur.idx() + 1 >= nargs())
+ if (cur.idx() == cur.lastidx())
return false;
++cur.idx();
cur.pos() = 0;
BOOST_ASSERT(cur.inset() == this);
if (nargs() == 0)
return false;
- cur.idx() = nargs() - 1;
+ cur.idx() = cur.lastidx();
cur.pos() = cur.lastpos();
return true;
}