Hello,
Vincent van Ravesteijn wrote:
Maybe it's already "wrong" to do this buffer management in lyxfind.cpp.
[...]
Well there is a way to do this. See the attached patch.
However, I'm not sure whether everyone likes this approach. Anyway, I
think the concept of the LFUN being dispatched or not is what you
need: did I get a result or didn't anything happen.
just to mention that r32760 follows your advice (scopes and buffer
switch handled in F&R widget).
This rework hopefully simplified some "spaghetti" logics I had in the
code (especially for backwards search), and it eliminated a crash
occurring when continuously switching from searching forward to
backwards and vice-versa, and each time a buffer change was needed.
However, some more testing is needed.
The only "drawback", as compared to the previous approach in which I was
directly using "GuiView::setBuffer()", is that the buffers in which the
search is performed are displayed anyway by LFUN_BUFFER_SWITCH. So, if
multiple buffers are searched within a scope before finding a match, the
user sees this fast changing of buffers before the GUI stops on the
matching element. In case no match is found, the last buffer in the
scope is temporarily shown while the dialog prompts the user, etc....
Bye,
T.