Bo Peng wrote: > 1. Open a document, edit the first paragraph > 2. Scroll down a few pages, using mouse or page down key > 3. File->save > 4. Lyx will scroll back to the beginning of the document.
Please try the attached patch. Jürgen
Index: src/lyxfunc.C =================================================================== --- src/lyxfunc.C (Revision 13689) +++ src/lyxfunc.C (Arbeitskopie) @@ -723,7 +723,8 @@ void LyXFunc::dispatch(FuncRequest const errorstat = false; dispatch_buffer.erase(); - bool update = false; + bool updateforce = false; + bool update = true; FuncStatus const flag = getStatus(cmd); if (!flag.enabled()) { @@ -815,10 +816,12 @@ void LyXFunc::dispatch(FuncRequest const owner->message(str + _(" done.")); } else writeAs(owner->buffer()); + update = false; break; case LFUN_WRITEAS: writeAs(owner->buffer(), argument); + update = false; break; case LFUN_MENURELOAD: { @@ -1433,7 +1436,7 @@ void LyXFunc::dispatch(FuncRequest const } // ideally, the update flag should be set by the insets, // but this is not possible currently - update = true; + updateforce = true; break; } @@ -1457,7 +1460,7 @@ void LyXFunc::dispatch(FuncRequest const it->dispatch(tmpcur, fr); } } - update = true; + updateforce = true; break; } @@ -1565,7 +1568,7 @@ void LyXFunc::dispatch(FuncRequest const bufferErrors(*buffer, el); view()->showErrorList(_("Class switch")); updateLabels(*buffer); - update = true; + updateforce = true; break; } @@ -1592,9 +1595,9 @@ void LyXFunc::dispatch(FuncRequest const default: { view()->cursor().dispatch(cmd); - update |= view()->cursor().result().update(); + updateforce |= view()->cursor().result().update(); if (!view()->cursor().result().dispatched()) - update |= view()->dispatch(cmd); + updateforce |= view()->dispatch(cmd); break; } } @@ -1603,9 +1606,9 @@ void LyXFunc::dispatch(FuncRequest const // Redraw screen unless explicitly told otherwise. // This also initializes the position cache for all insets // in (at least partially) visible top-level paragraphs. - if (update) + if (updateforce) view()->update(Update::FitCursor | Update::Force); - else + else if (update) view()->update(Update::FitCursor); // if we executed a mutating lfun, mark the buffer as dirty