Em Qua 01 Mar 2006 10:13, Angus Leeming escreveu: > Lars Gullik Bjønnes <[EMAIL PROTECTED]> writes: > > Angus Leeming <[EMAIL PROTECTED]> writes: > > | João Luis Meloni Assirati <assirati <at> ...> writes: > > | > Now that lyx is very close to a release, I publish again in this > > | > list my dvi search patch. I intend to maintain this patch for > > | > all releases of the 1.4 series as long as it remain useful to me. > > | > > | Can we *please* get this into LyX 1.4.x! This thing has been > > | two years in develpment and it's frankly *rude* that it isn't > > | in already. > > > > I am waiting for you code reviews then, so that we can put it into > > 1.5.0svn for later backport to 1.4.x. > > Ok... > > João, I've just read through your patch and in general it looks good. > > The only piece of *code* that I'm nervous about is this snippet in > src/lyxfunc.C and only because I've been listening in to others much more > knowledgable than me working hard to optimise these updates. > > @@ -1131,10 +1131,8 @@ > } > > view()->setCursorFromRow(row); > - > view()->center(); > - // see BufferView_pimpl::center() > - view()->updateScrollbar(); > + view()->update(); > break; > }
I am not able to follow all those discussions about how often lyx updates. I know that this is a very important issue, I can remember lyx releases that where very annoying because of flickering. However, this update is called only when one calls an inverse search and will not compromise any optimization. > > However, I have a question about your *design*. > > The row ID that is returned by the BufferView::texrow_ref() function is > passed to xdvi when I click on the LyX document, changing the view in xdvi > to this part of the .dvi document. No, it is passed to xdvi by a command line, that is, only when it starts (something like /usr/bin/xdvi -sourceposition \ 692 /tmp/lyx_tmpdir25961COhyoZ/lyx_tmpbuf0/UserGuide_pre.tex \ UserGuide_pre.dvi (All in one line) That said, I can only perform another forward search (after I changed the lyx view) if I do another view->dvi. Note that with the option -sourceposition, xdvi will operate in "client mode" and do a new search without starting a new xdvi process. > > What will happen if, after I generate the .dvi file and launch xdvi, I > change the width of the LyX window? My understanding is that the IDs in the > .dvi file will now be out of sync with BufferView::texrow_ref(). Right? Right, but this is irrelevant since once xdvi started, it cannot communicate anymore with lyx (aside by runing xdvi again). > > I imagine that the same thing would happen when I clicked in the xdvi > window, precipitating a change of view in LyX. In either case, if I change > the width of the LyX window, the LyX view and the .dvi view are no longer > going to be in sync. Oh, this will not happen because xdvi talks latex rows and lyx talks paragraph ids / positions. TexRow::getIdFromRow will translate correctly, no matter the current geometry of the lyx window. > > If I am right then I think that you should move the IDs out of BufferView > and into Buffer. Please reconsider your opinion. It is very important for me to work within BufferView so I have access to texrow_ref. > > Thoughts? > > Angus Thank you, Angus. How is William doing? João.