2002-05-02 Juergen Vigna <jug@sad.it>
+ * text2.C (fixCursorAfterDelete): check to make sure we don't request
+ to set the cursor behind the pargraph with > size().
+ (setCursor): check also for the same paragraph when checking where
+ to put the cursor if we have a NFR inset.
+
* buffer.C (parseSingleLyXformat2Token): move the compatibility
parts of layout read further up as it still was in the wrong
position.
cur.iy(y + row->baseline());
Inset * ins;
if (row->previous() && pos &&
+ row->previous()->par() == row->par() &&
par->getChar(pos) == Paragraph::META_INSET &&
(ins=par->getInset(pos)) && (ins->needFullRow() || ins->display()))
{
if (cur.pos() > where.pos())
cur.pos(cur.pos()-1);
+ // check also if we don't want to set the cursor on a spot behind the
+ // pagragraph because we erased the last character.
+ if (cur.pos() > cur.par()->size())
+ cur.pos(cur.par()->size());
+
// recompute row et al. for this cursor
setCursor(bview, cur, cur.par(), cur.pos(), cur.boundary());
}