Lars Gullik Bjønnes wrote:
> | DELETE KEY DOES NOT MOVE THE CURSOR TO THE NEXT CHARACTER
>
> If this has a simple fix it should be done, otherwise it should wait.

It is as simple as the attached. I've tested pretty intensive, some further 
testing would be welcome, though.

Jürgen
Index: src/rowpainter.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/rowpainter.C,v
retrieving revision 1.162
diff -p -u -r1.162 rowpainter.C
--- src/rowpainter.C	1 Jan 2006 23:06:23 -0000	1.162
+++ src/rowpainter.C	9 Jan 2006 14:52:51 -0000
@@ -735,7 +735,7 @@ bool isCursorOnRow(PainterInfo & pi, pit
 	for (lyx::size_type d = 0; d < cur.depth(); d++)
 		if (cur[d].pit() == pit
 	  	    && cur[d].pos() >= rit->pos()
-		    && cur[d].pos() < rit->endpos())
+		    && cur[d].pos() <= rit->endpos())
 			return true;
 	return false;
 }
Index: src/text.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text.C,v
retrieving revision 1.639
diff -p -u -r1.639 text.C
--- src/text.C	19 Dec 2005 12:30:33 -0000	1.639
+++ src/text.C	9 Jan 2006 14:52:55 -0000
@@ -1543,6 +1543,10 @@ bool LyXText::Delete(LCursor & cur)
 		recordUndo(cur, Undo::DELETE, cur.pit());
 		setCursorIntern(cur, cur.pit(), cur.pos() + 1, false, cur.boundary());
 		needsUpdate = backspace(cur);
+		Paragraph & par = cur.paragraph();
+		if (cur.pos() < par.size()
+		    && par.lookupChange(cur.pos()) == Change::DELETED)
+			cur.posRight();
 	} else if (cur.pit() != cur.lastpit()) {
 		LCursor scur = cur;
 

Reply via email to