Jean-Marc Lasgouttes wrote:

> This patch fixes the following bug:
> 
> 1/ create an InsetInclude with type 'include'
> 
> 2/ place the cursor after the inset and hit <return>
> 
> 3/ see how the button turned into a small white square.
> 
> The following patch fixes it here. Angus, I'd appreciate your comments
> on whether it is the right way to do it.

I'm not sure :-( Probably. Clearly the existing code is wrong.


When the label is changed from the dialog, doDispatch calls this function:

void InsetInclude::set(InsetCommandParams const & p, Buffer const & buffer)
{
    params_ = p;
    set_label_ = false;

    if (preview_->monitoring())
        preview_->stopMonitoring();

    if (type(params_) == INPUT)
        add_preview(*preview_, *this, buffer);
}

So the previewing code needs to know the parent Buffer. All is OK when a 
new buffer is read because all previewed snippets are accumulated in a 
separate loop before being handed over to the preview generation machinery.

What happens if you have enable instant preview and you paste the inset 
into a new buffer? Is the preview displayed?

-- 
Angus

Reply via email to