The attached patch improves handling of PageUp/Down in things like tables
and note insets: If the cursor is in the first respectively last line of
the inset, it will leave the inset. This also removes the "pseudo
deadlocks" when scrolling down with PageDown leads the cursor through a
table.
This might qualify as "new feature", but it cures at least two problems I
had.
Ok to apply?
Andre'
--
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)
Index: lyxtext.h
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyxtext.h,v
retrieving revision 1.127
diff -u -p -r1.127 lyxtext.h
--- lyxtext.h 29 Aug 2002 12:00:50 -0000 1.127
+++ lyxtext.h 9 Oct 2002 15:27:39 -0000
@@ -346,6 +346,10 @@ public:
///
void cursorEnd(BufferView *) const;
///
+ void cursorPrevious(BufferView * bv);
+ ///
+ void cursorNext(BufferView * bv);
+ ///
void cursorTab(BufferView *) const;
///
void cursorTop(BufferView *) const;
@@ -487,10 +491,6 @@ private:
///
void cursorLeftOneWord(LyXCursor &) const;
- ///
- void cursorPrevious(BufferView * bv);
- ///
- void cursorNext(BufferView * bv);
///
float getCursorX(BufferView *, Row *, lyx::pos_type pos,
Index: insets/insettext.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insettext.C,v
retrieving revision 1.332
diff -u -p -r1.332 insettext.C
--- insets/insettext.C 25 Sep 2002 14:26:12 -0000 1.332
+++ insets/insettext.C 9 Oct 2002 15:27:39 -0000
@@ -1340,6 +1340,24 @@ Inset::RESULT InsetText::localDispatch(F
lt->cursorEnd(bv);
updwhat = CURSOR;
break;
+ case LFUN_PRIOR:
+ if (!crow(bv)->previous())
+ result = FINISHED_UP;
+ else {
+ lt->cursorPrevious(bv);
+ result = DISPATCHED_NOUPDATE;
+ }
+ updwhat = CURSOR;
+ break;
+ case LFUN_NEXT:
+ if (!crow(bv)->next())
+ result = FINISHED_DOWN;
+ else {
+ lt->cursorNext(bv);
+ result = DISPATCHED_NOUPDATE;
+ }
+ updwhat = CURSOR;
+ break;
case LFUN_BACKSPACE: {
setUndo(bv, Undo::DELETE,
lt->cursor.par(), lt->cursor.par()->next());
@@ -1896,8 +1914,7 @@ InsetText::moveLeftIntern(BufferView * b
}
-Inset::RESULT
-InsetText::moveUp(BufferView * bv)
+Inset::RESULT InsetText::moveUp(BufferView * bv)
{
if (!crow(bv)->previous())
return FINISHED_UP;
@@ -1906,8 +1923,7 @@ InsetText::moveUp(BufferView * bv)
}
-Inset::RESULT
-InsetText::moveDown(BufferView * bv)
+Inset::RESULT InsetText::moveDown(BufferView * bv)
{
if (!crow(bv)->next())
return FINISHED_DOWN;