On Fri, 23 Sep 2005 17:26:48 +0200 Jean-Marc Lasgouttes <[EMAIL PROTECTED]> 
wrote:

> Martin Vermeer wrote:
> > I believe the culprit is
> > 
> >                 if (!singlepar || pit1 == cursor_.pit())
> > 
> > which I added several times to BufferView_pimpl.C:s metrics method.
> It
> > tests for being in the paragraph containing the cursor... but I
> believe
> > cursor_.pit() refers to the paragraph iterator _inside_ the inset,
> when
> > what we need to have here is the paragraph iterator in the
> surrounding
> > text which _contains_ this inset (and the cursor).
> > 
> > Anybody know how to do that? cursor_[0].pit() ?
> 
> Yes, cursor.pit() is really cursor.top().pit(), so this is the 
> most-nested cursor slice.
> 
> You can also use cursor.bottom().pit() to get the outermost one. But
> zhy
> is this the one you need?

Just a hunch ;-)

No, seriously: the screen redraw routine renders the paragraph(s) the
ViewMetricsInfo that the BufferView_pimpl metrics hands it, as _main text_
paragraphs -- recursively descending into any insets it contains. If handed an
inside-inset pit, it will nevertheless interpret it as a main-text pit, and
things will go haywire _in case we are in SinglePar mode_.

BTW am I right in understanding that descending into the cursor stack means
moving from bottom downward to top (tip?), increasing depth all the time? How
logical...

Which do you prefer BTW, .bottom() or [0]?

- Martin

Reply via email to