Vincent van Ravesteijn - TNW wrote:
I prefer to use lyx::dispatch(FuncRequest(LFUN_BUFFER_SWITCH,
                                dest_buffer_->absFileName()));

or isn't that possible ?

I guess we try to keep the LyXView.h interface as small as possible.

SelectDocumentBuffer does nothing else than to call setBuffer.
I was assuming something else would have been needed in that method in order to open & display "properly" the buffer (later I discovered that children are already loaded but "hidden").

I tried the change you propose and seems to behave the same, so I would remove the LyXView.h new method.

However, I'd like to raise your attention to another issue: when searching in S_OPEN_BUFFERS scope, currently I'm searching within both explicitly open (and displayed) and hidden buffers. Apparently, from a user perspective, it may seem more clear to search only within explicitly (and displayed) open buffers.
However, in order to implement this, I would need to call the

 GuiWorkArea * GuiView::workArea(Buffer & buffer)

method, in order to check whether the buffer has an associated view or not, while selecting the next buffer to search within. Unfortunately, this would require me to add the above method to LyXView, in a form that is qt-unaware, smth. like

 WorkArea * LyXView::workArea(Buffer & buffer)

and let the former method to be a refinement of it (if allowed by C++), or to introduce a completely new method in LyXView

 bool GuiView::hasWorkArea(Buffer & buffer)

Or, is there any other way via interfaces already in place ?

Thanks, bye,

   T.

Reply via email to