Jean-Marc Lasgouttes <[EMAIL PROTECTED]> writes: > Then a more annoying problem occurs: in findnextChange, we have the code > > // avoid crash (assertion violation) if the imaginary end-of-par > // character of the last paragraph of the document is marked as changed > if (tip.at_end()) > tip.backwardPos(); > > This is obviously wrong when the change extends to the last character of the > inset: in this case, this last character will not be selected... > > I would be tempted to remove this code, but I do not know how to test > for this "if the imaginary end-of-par character of the last paragraph of > the document is marked as changed" condition".
After thinking more about it and trying it out I think now it is the right solution. This code was needed when we were iterating with the full cursor (not the top slice). Alfredo missed this when he rewrite the code last year. Jose'? JMarc
svndiff src/lyxfind.cpp Index: src/lyxfind.cpp =================================================================== --- src/lyxfind.cpp (revision 27078) +++ src/lyxfind.cpp (working copy) @@ -333,10 +333,6 @@ bool findNextChange(BufferView * bv) if (change != orig_change) break; } - // avoid crash (assertion violation) if the imaginary end-of-par - // character of the last paragraph of the document is marked as changed - if (tip.at_end()) - tip.backwardPos(); // Now put cursor to end of selection: bv->cursor().setCursor(cur);