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
This commit is contained in:
Abdelrazak Younes 2006-11-27 12:49:28 +00:00
parent 93481d2d56
commit 5df2f4ed06
2 changed files with 22 additions and 1 deletions

View File

@ -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();

View File

@ -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);
}