From fcc89010ecff27b43f1d7a06add7df6b6452f545 Mon Sep 17 00:00:00 2001 From: Alfredo Braunstein Date: Fri, 13 Feb 2004 09:50:18 +0000 Subject: [PATCH] a fix for s&r git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@8429 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/cursor.C | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index e822b80ea1..66cf1e442e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2004-02-13 Alfredo Braunstein + + * cursor.C (dispatch): restore current_ before returning + 2004-02-13 Alfredo Braunstein * text2.C (cursorUp, cursorDown): fix coords diff --git a/src/cursor.C b/src/cursor.C index 9c53dd5e0f..4cdb780ad7 100644 --- a/src/cursor.C +++ b/src/cursor.C @@ -83,8 +83,11 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0) FuncRequest cmd = cmd0; for (current_ = cursor_.size() - 1; current_ >= 1; --current_) { DispatchResult res = inset()->dispatch(*this, cmd); - if (res.dispatched()) + if (res.dispatched()) { + current_ = cursor_.size() - 1; return DispatchResult(true, true); + } + // "Mutate" the request for semi-handled requests that need // additional handling in outer levels. @@ -110,6 +113,7 @@ DispatchResult LCursor::dispatch(FuncRequest const & cmd0) BOOST_ASSERT(current_ == 0); DispatchResult res = bv_->text()->dispatch(*this, cmd); //lyxerr << " result: " << res.val() << endl; + current_ = cursor_.size() - 1; return res; } -- 2.39.2