On Sun, Sep 13, 2009 at 06:47:56PM +0200, Enrico Forestieri wrote:

> On Sun, Sep 13, 2009 at 03:58:13PM +0200, Vincent van Ravesteijn - TNW wrote:
> 
> >  
> > >> ..or by removing the code that was added in 
> > >> http://www.lyx.org/trac/changeset/30425. I think the completion
> > >> just signals an invalid cursor or something like that.
> > >
> > >Hmm... I really think that a headache is better cured by a cachet
> > >rather than by an amputation.
> > >
> > >Crash fixed at r31379.
> > >
> > 
> > Do you know why LyX crashed ? What is the difference between
> > cur.niceInsert() and cur.insert().
> > 
> > It feels a bit fragile that if you use the wrong function LyX starts
> > crashing, and I would like to understand these things.
> 
> Seems that it is you having a headache now? ;-)

SCNR.

The point is that niceInsert() was wrong in this context. It works such
that when you have a selection, the selection is pasted into the first
cell of the newly inserted inset. Now, the backspace() in the code was
meant to delete the previous inset. However, certain insets (\frac,
\mathcal, etc.) are not immediately deleted, but they are first selected.
So, the niceInsert() was deleting the old inset and then was trying to
reinsert it in the first cell, causing havoc.

-- 
Enrico

Reply via email to