Martin Vermeer wrote: > The problem was indeed, that if the target paragraph is inside an > inset, then in lyxfunc.C dispatch() LFUN_GOTO_PARAGRAPH we have > a call to setCursor() which takes its 'this' from the main LyXText of > the document, while the paragraph is in the internal LyXText of the > inset. Obviously doesn't work, as the debugging code in text.C -- a > homebrew distance() function -- told me in no uncertain terms. > > (BTW should we be using a std::distance() that hangs in this way > instead of giving a clear error?) > > Now I modified lyxfunc.C so it takes the correct LyXText in this case, > and indeed distance() works OK now. Only... the cursor doesn't > actually get positioned. In fact it doesn't budge at all. Bummer.
Inset locking. If I'm not mistaken, you have to call BufferView::lockInset with the inset your lyxtext is in (or the top level inset, I don't remember). The current cursor handling is distributed, that is: every insettext has a cursor. If there is no top-inset locked, the cursor in the top insettext is used and all others ignored. If there is some inset locked, then you go down that path in the tree and ask the question again. Or something like that (:-)). Try to experiment a little with inset locking. Luckily at some time we will switch to an extern, global cursor handling (that will hold directly all the path in the tree)... Regards, Alfredo