second attempt to have an updateless cursor movement. The structural work was already done some months ago... ;-)
Can anyone see something wrong with this? Alfredo
? PosIterator.C-save ? PosIterator.h-save ? all.diff ? bfs.cpp ? files ? save ? frontends/screen.C-save Index: cursor.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/cursor.C,v retrieving revision 1.100 diff -u -p -u -r1.100 cursor.C --- cursor.C 29 Apr 2004 14:48:59 -0000 1.100 +++ cursor.C 15 May 2004 11:12:07 -0000 @@ -386,14 +386,8 @@ void LCursor::info(std::ostream & os) co void LCursor::selHandle(bool sel) { //lyxerr << "LCursor::selHandle" << endl; - if (sel == selection()) { -#ifdef WITH_WARNINGS -#warning Alfredo: This is too strong (Andre) -#endif - //if (!sel) - // noUpdate(); + if (sel == selection()) return; - } resetAnchor(); selection() = sel; Index: text3.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/text3.C,v retrieving revision 1.252 diff -u -p -u -r1.252 text3.C --- text3.C 29 Apr 2004 09:54:57 -0000 1.252 +++ text3.C 15 May 2004 11:12:10 -0000 @@ -382,6 +382,8 @@ void LyXText::dispatch(LCursor & cur, Fu BOOST_ASSERT(cur.text() == this); BufferView * bv = &cur.bv(); CursorSlice sl = cur.top(); + bool sel = cur.selection(); + switch (cmd.action) { @@ -1586,6 +1588,13 @@ void LyXText::dispatch(LCursor & cur, Fu cur.undispatched(); break; } + + // avoid to update when navigating + if (&sl.inset() == &cur.inset() + && sl.idx() == cur.idx() + && sel == false + && cur.selection() == false) + cur.noUpdate(); }