fix x^1<space>_

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2876 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-10-12 15:38:58 +00:00
parent 400fcfa1ee
commit db033af700
4 changed files with 37 additions and 6 deletions

View File

@ -16,6 +16,7 @@
#include <fstream>
#include "Lsstream.h"
#include "support/LAssert.h"
#ifdef __GNUG__
#pragma implementation
@ -641,10 +642,11 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
result = UNDISPATCHED;
}
lyx::Assert(mathcursor);
//mathcursor->normalize();
if (was_macro != mathcursor->inMacroMode()
&& action >= 0 && action != LFUN_BACKSPACE)
if (//was_macro != mathcursor->inMacroMode() &&
action >= 0 && action != LFUN_BACKSPACE)
updateLocal(bv, true);
if (mathcursor->selection() || was_selection)

View File

@ -132,9 +132,10 @@ MathCursor::MathCursor(InsetFormulaBase * formula, bool left)
void MathCursor::push(MathAtom & t)
{
//cerr << "Entering atom "; t->write(cerr, false); cerr << " left\n";
MathCursorPos p;
p.par_ = &t;
p.idx_ = 0;
p.pos_ = 0;
Cursor_.push_back(p);
}
@ -937,7 +938,10 @@ void MathCursor::normalize() const
if (pos() > size()) {
lyxerr << "this should not really happen - 2: "
<< pos() << " " << size() << "\n";
<< pos() << " " << size() << " in idx: " << it->idx()
<< " in atom: '";
it->par()->write(lyxerr, false);
lyxerr << "\n";
dump("error 4");
}
it->pos() = min(pos(), size());
@ -1321,17 +1325,22 @@ void MathCursor::interpret(char c)
if (hasPrevAtom() && prevAtom()->asScriptInset()) {
prevAtom()->asScriptInset()->ensure(up);
pushRight(prevAtom());
idx() = up;
pos() = size();
} else if (hasNextAtom() && nextAtom()->asScriptInset()) {
nextAtom()->asScriptInset()->ensure(up);
pushLeft(nextAtom());
idx() = up;
pos() = 0;
} else {
plainInsert(MathAtom(new MathScriptInset(up)));
prevAtom()->asScriptInset()->ensure(up);
pushRight(prevAtom());
}
idx() = up;
pos() = 0;
}
selPaste();
dump("1");
return;
}
@ -1393,7 +1402,6 @@ void MathCursor::interpret(char c)
else
insert(c, LM_TC_VAR);
#warning greek insert problem? look here!
if (lastcode_ == LM_TC_GREEK1)
lastcode_ = LM_TC_VAR;
return;

View File

@ -294,3 +294,19 @@ bool MathScriptInset::hasDown() const
{
return script_[0];
}
bool MathScriptInset::idxRight(MathInset::idx_type &,
MathInset::pos_type &) const
{
return false;
}
bool MathScriptInset::idxLeft(MathInset::idx_type &,
MathInset::pos_type &) const
{
return false;
}

View File

@ -40,6 +40,11 @@ public:
///
int width(MathInset const * nucleus) const;
///
bool idxLeft(MathInset::idx_type &, MathInset::pos_type &) const;
///
bool idxRight(MathInset::idx_type &, MathInset::pos_type &) const;
///
MathScriptInset const * asScriptInset() const;
///