From: André Pönitz Date: Thu, 25 Oct 2001 14:46:57 +0000 (+0000) Subject: partial fix for 'two spaces in a row in math text' X-Git-Tag: 1.6.10~20423 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=549d6b74416a79f629fb2f9205c322dfadc64e4b;p=features.git 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 --- diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index a4cc75efaa..25a86f1b7e 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -73,9 +73,9 @@ struct Selection MathCursorPos i1; MathCursorPos i2; cursor.getSelection(i1, i2); - if (i1.idx_ == i2.idx_) { + if (i1.idx_ == i2.idx_) i1.cell().erase(i1.pos_, i2.pos_); - } else { + else { std::vector indices = (*i1.par_)->idxBetween(i1.idx_, i2.idx_); for (unsigned i = 0; i < indices.size(); ++i) @@ -1366,6 +1366,11 @@ void MathCursor::interpret(char c) selDel(); if (lastcode_ == LM_TC_TEXTRM) { + // suppress direct insertion of to spaces in a row + // the still allows typing 'a' and deleting the 'a', but + // it is better than nothing + if (hasPrevAtom() && prevAtom()->getChar() == ' ') + return; insert(c, LM_TC_TEXTRM); return; } @@ -1376,13 +1381,7 @@ void MathCursor::interpret(char c) return; } - if (mathcursor->popRight()) - return; - -#warning look here - // this would not work if the inset is in an table! - //bv->text->cursorRight(bv, true); - //result = FINISHED; + mathcursor->popRight(); return; }