Pavel Sanda ha scritto:
Tommaso Cucinotta wrote:
this is a patch for providing "awareness", within LyXView, of the distinction between: - the currently selected buffer (i.e., document buf, search buf, replace buf), retrieved using
 LyXView::buffer()
- the buffer containing the actual document, retrieved using:
 LyXView::mainBuffer()

sorry i didn't get the distinction from this comment. could you elaborate?
pavel
Sure: on current trunk, if I activate the "Find LyX..." feature, then a panel is shown on the right, with two additional ("helper") WorkAreas (with distinct associate buffers): the first one allows you to enter text to search for, the second one allows you to enter the replacement. Additionally, there is the "main document" WA still showing of course the document over which we are searching, highlighting matches, etc....

This distinction is about the buffer of the currently selected WA (one of the "main document" WA, the search WA or the replace WA, but others might come in future), and the buffer of the "main document" that we are editing. For example, in the case of the Find LyX... panel, if the user is replacing some text, and has the focus on one of the "helper" WAs, typing Ctrl-t (or corresponding menu voice) should preview the main document (I can see no meaning in previewing in .pdf the search/replace WA contents).

While on the GUI side this distinction used to exist through the GuiView::currentWorkarea() vs GuiView::currentMainWorkArea() methods, on the model side (LFUN implementation, i.e., from inside LyXFunc.cpp), currently only the selected WA's buffer was visible, through the LyXView::buffer() method. With this patch, we can retrieve the main document buffer as well, through the LyXView::mainBuffer() method.

Hope now it's more clear.

   T.

Reply via email to