This is a bug of BufferView::workAreaDispatch. When InsetCollapsable
is invoked, cur does not point inside the inset (as most code assumes)
but just outside. I do not know when this change happened, but it
should be reverted.

Index: src/insets/insetcollapsable.C
===================================================================
--- src/insets/insetcollapsable.C       (revision 16710)
+++ src/insets/insetcollapsable.C       (working copy)
@@ -306,7 +306,7 @@
InsetBase * InsetCollapsable::editXY(LCursor & cur, int x, int y)
{
       //lyxerr << "InsetCollapsable: edit xy" << endl;
-       if (status() == Collapsed || button_dim.contains(x, y))
+       if (status() == Collapsed || (button_dim.contains(x, y) &&
status() != Inlined))
               return this;
       cur.push(*this);
       return InsetText::editXY(cur, x, y);
@@ -320,7 +320,7 @@

       switch (cmd.action) {
       case LFUN_MOUSE_PRESS:
-               if (cmd.button() == mouse_button::button1 && hitButton(cmd)) {
+               if (cmd.button() == mouse_button::button1 &&
hitButton(cmd) && status() != Inlined) {
                       // reset selection if necessary (see bug 3060)
                       if (cur.selection())
                               cur.bv().cursor().clearSelection();


Should fix this. The first change was done by me
((button_dim.contains(x, y) ) to not add text to cursor when the inset
is closed (the cursor before inset crash). The inline case is
forgotten. I do not know who is responsible for the second missing
Inline case.

OK to apply?
Bo

Reply via email to