From d4b960c5f49ceff926e7d4d4d5864bfb796d69d6 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Fri, 5 Apr 2013 15:58:08 +0200 Subject: [PATCH] Fix bug #8370: crash when searching for next change Cursor::backwardPos() may enter in a nested inset, while CursorSlice::backwardPos() will not. --- src/lyxfind.cpp | 7 ++++--- status.20x | 2 ++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index f74da52f0c..a81e293fc2 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -447,13 +447,14 @@ bool findChange(BufferView * bv, bool next) bv->cursor().setCursor(cur); bv->cursor().resetAnchor(); + CursorSlice & tip = cur.top(); + if (!next) // take a step into the change - cur.backwardPos(); + tip.backwardPos(); - Change orig_change = cur.paragraph().lookupChange(cur.pos()); + Change orig_change = tip.paragraph().lookupChange(tip.pos()); - CursorSlice & tip = cur.top(); if (next) { for (; !tip.at_end(); tip.forwardPos()) { Change change = tip.paragraph().lookupChange(tip.pos()); diff --git a/status.20x b/status.20x index fc99d80893..7ece4fbc3a 100644 --- a/status.20x +++ b/status.20x @@ -120,6 +120,8 @@ What's new - Fix crash when clicking on a completion in math mode (bug 8296). +- Fix assertion when searching for next change (bug 8370). + - Fix regression in which clicking in the main work area always resets the selected format in View -> Source (bug 8411). -- 2.39.5