From a88e5cbf7427ac776ba40a69b06cf53201c5897f 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 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 50a50598e7..a01fbd6309 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -452,13 +452,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());