From: Jean-Marc Lasgouttes Date: Fri, 5 Apr 2013 13:58:08 +0000 (+0200) Subject: Fix bug #8370: crash when searching for next change X-Git-Tag: 2.1.0beta1~421 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a88e5cbf7427ac776ba40a69b06cf53201c5897f;p=lyx.git Fix bug #8370: crash when searching for next change Cursor::backwardPos() may enter in a nested inset, while CursorSlice::backwardPos() will not. --- 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());