On Sun, Feb 26, 2006 at 07:25:51PM +0100, Georg Baum wrote:
> Am Sonntag, 26. Februar 2006 17:53 schrieb Martin Vermeer:

...
 
> > The assumption here appears to be that the argument to give to the
> > LFUN_PASTE call is the _text_ to be pasted into the doc. Checking the
> > places where LFUN_PASTE is executed (i.e., text2.C and
> > math_nestinset.C), however, shows that the text to be pasted comes from
> > _buffer number_ n, an integer contained in the cmd.argument transferred.
> > 
> > So I believe there is a "thinko" here, which explains why the
> > selection disappears into the black hole and is never inserted -- at
> > least for math.
> 
> That is indeed a problem, but unrelated, because LCursor::paste() is not 
> invoked for \mathbb. I filed it at 
> http://bugzilla.lyx.org/show_bug.cgi?id=2327 and attached also a possible 
> fix.
> 
> There seems to be a different thinko involved in the \mathbb problem: 
> LCursor::handleNest() operates on a selection, but the selection may be 
> empty if you insert '\mathbb R' from the math panel (and its contents 
> will be wrong even if it is not empty).
> The attached patch improves the situation a bit by invoking handleNest() 
> only if there is a selection. That makes '\mathbb R' work again for the 
> case where nothing is selected.

No... this is a 'kludge' again.

The attached works for both decorations and fonts, including mathbb. Try
it! (This is must be used with your reversal of my patch to math_nestinset,
i.e., use only niceInsert)

- Martin

Index: cursor.C
===================================================================
--- cursor.C    (revision 13276)
+++ cursor.C    (working copy)
@@ -712,7 +725,7 @@
                // be careful here: don't use 'pushLeft(t)' as this we need to
                // push the clone, not the original
                pushLeft(*nextInset());
-               paste(safe);
+               insert(safe);
        }
 }
 

Attachment: pgpvfW6NXIqdN.pgp
Description: PGP signature

Reply via email to