From 5df2f4ed06fe4673e7994d06077b5dedc5dc7807 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Mon, 27 Nov 2006 12:49:28 +0000 Subject: [PATCH] Fix screen updates with arrow key navigation. * text2.C - LyXText::cursorUp(): ensure that BufferView::FitCursor() is tested. - LyXText::cursorDown(): ditto - LyXText::cursorRight(): ditto - LyXText::cursorLeft(): ditto * text3.C - LyXText::dispatch(): add FIXME and ensure that update flag is at least equal to FitCursor. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16072 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/text2.C | 12 ++++++++++++ src/text3.C | 11 ++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/text2.C b/src/text2.C index 0513d5181c..680fa350ee 100644 --- a/src/text2.C +++ b/src/text2.C @@ -1024,6 +1024,9 @@ bool LyXText::checkAndActivateInset(LCursor & cur, bool front) bool LyXText::cursorLeft(LCursor & cur) { + // Tell BufferView to test for FitCursor in any case! + cur.updateFlags(Update::FitCursor); + if (!cur.boundary() && cur.pos() > 0 && cur.textRow().pos() == cur.pos() && !cur.paragraph().isLineSeparator(cur.pos()-1) && @@ -1052,6 +1055,9 @@ bool LyXText::cursorLeft(LCursor & cur) bool LyXText::cursorRight(LCursor & cur) { + // Tell BufferView to test for FitCursor in any case! + cur.updateFlags(Update::FitCursor); + if (cur.pos() != cur.lastpos()) { if (cur.boundary()) return setCursor(cur, cur.pit(), cur.pos(), @@ -1081,6 +1087,9 @@ bool LyXText::cursorRight(LCursor & cur) bool LyXText::cursorUp(LCursor & cur) { + // Tell BufferView to test for FitCursor in any case! + cur.updateFlags(Update::FitCursor); + Paragraph const & par = cur.paragraph(); int row; int const x = cur.targetX(); @@ -1130,6 +1139,9 @@ bool LyXText::cursorUp(LCursor & cur) bool LyXText::cursorDown(LCursor & cur) { + // Tell BufferView to test for FitCursor in any case! + cur.updateFlags(Update::FitCursor); + Paragraph const & par = cur.paragraph(); int row; int const x = cur.targetX(); diff --git a/src/text3.C b/src/text3.C index f74cc67f17..96ef5b1ec3 100644 --- a/src/text3.C +++ b/src/text3.C @@ -1518,7 +1518,16 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd) && oldTopSlice.idx() == cur.idx() && !sel // sel is a backup of cur.selection() at the biginning of the function. && !cur.selection()) - cur.noUpdate(); + // FIXME: it would be better if we could just do this + // + //if (cur.result().update() != Update::FitCursor) + // cur.noUpdate(); + // + // But some LFUNs do not set Update::FitCursor when needed, so we + // do it for all. This is not very harmfull as FitCursor will provoke + // a full redraw only if needed but still, a proper review of all LFUN + // should be done and this needsUpdate boolean can then be removed. + cur.updateFlags(Update::FitCursor); else cur.updateFlags(Update::Force | Update::FitCursor); } -- 2.39.2