Juergen Spitzmueller wrote:
> Lars Gullik Bjønnes wrote:
> > It changes some details that I am not sure will not have side-effects.
>
> I cannot exclude that in last consequence, of course, even if I've tested
> lots of possible cases. Maybe someone else could give it a hard test.
>
> > | > I think this should wait so that it can get some more testing first.
> > |
> > | Your call of course.
> >
> > May I have the row-painter fix as a separate patch, please?
>
> Yes, as soon as I'm on my home machine again (not before Thursday).

Attached are the two fixes in separate patches.

2185-1.diff: rowpainter fix: assures that the row a cursor is in is always 
being redrawn, also if the cursor is at the last position of this row.
Without this patch, the screen is not updated if the last char of a row is 
deleted (with DELETE) in change tracking mode. You can reproduce that easily 
if you apply patch 2 without patch 1.

2185-2: the actual fix of DELETE in change tracking mode: moves the cursor one 
position right after DELETE iff the char to the right of the cursor is marked 
deleted. This happens in two cases: either this char has just been deleted or 
it has been deleted previously. In both cases, the cursor should be moved 
onwards. This only happens for single character deletions. Deletions of 
selections already work correctly.
The cur.pos() < par.size() check is necessary because lookupChange asserts 
that.

Jürgen
Index: 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
--- rowpainter.C	1 Jan 2006 23:06:23 -0000	1.162
+++ rowpainter.C	12 Jan 2006 12:46:41 -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: 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
--- text.C	19 Dec 2005 12:30:33 -0000	1.639
+++ text.C	12 Jan 2006 12:47:01 -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