partial fix for 'two spaces in a row in math text'

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2942 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
André Pönitz 2001-10-25 14:46:57 +00:00
parent 849400adb1
commit 549d6b7441

View File

@ -73,9 +73,9 @@ struct Selection
MathCursorPos i1; MathCursorPos i1;
MathCursorPos i2; MathCursorPos i2;
cursor.getSelection(i1, i2); cursor.getSelection(i1, i2);
if (i1.idx_ == i2.idx_) { if (i1.idx_ == i2.idx_)
i1.cell().erase(i1.pos_, i2.pos_); i1.cell().erase(i1.pos_, i2.pos_);
} else { else {
std::vector<MathInset::idx_type> indices = std::vector<MathInset::idx_type> indices =
(*i1.par_)->idxBetween(i1.idx_, i2.idx_); (*i1.par_)->idxBetween(i1.idx_, i2.idx_);
for (unsigned i = 0; i < indices.size(); ++i) for (unsigned i = 0; i < indices.size(); ++i)
@ -1366,6 +1366,11 @@ void MathCursor::interpret(char c)
selDel(); selDel();
if (lastcode_ == LM_TC_TEXTRM) { if (lastcode_ == LM_TC_TEXTRM) {
// suppress direct insertion of to spaces in a row
// the still allows typing '<space>a<space>' and deleting the 'a', but
// it is better than nothing
if (hasPrevAtom() && prevAtom()->getChar() == ' ')
return;
insert(c, LM_TC_TEXTRM); insert(c, LM_TC_TEXTRM);
return; return;
} }
@ -1376,13 +1381,7 @@ void MathCursor::interpret(char c)
return; return;
} }
if (mathcursor->popRight()) mathcursor->popRight();
return;
#warning look here
// this would not work if the inset is in an table!
//bv->text->cursorRight(bv, true);
//result = FINISHED;
return; return;
} }