Jean-Marc Lasgouttes wrote:
> Juergen> Indeed, but it does not only care for dEPM, but also if the
> Juergen> cursor is valid. I wonder, though, if the explicit set of
> Juergen> bvcursor is not redundand now.
>
> It may be interesting to experiment.

I commented those lines out and didn't see any bad effects at first glance. It 
looks like this:

if (cmd.button() == mouse_button::button1 
                    || (cmd.button() == mouse_button::button3 
                        && (&bvcur.selBegin().inset() != this || 
!tablemode(bvcur)))) {
                        cur.selection() = false;
                        setCursorFromCoordinates(cur, cmd.x, cmd.y);
                        // cares for dePM
                        cur.bv().mouseSetCursor(cur);
                        //cur.resetAnchor();
                        //bvcur = cur;
                        break;
                }

while BufferView::mouseSetCursor does:

void BufferView::mouseSetCursor(LCursor & cur)
{
        BOOST_ASSERT(&cur.bv() == this);

        // Has the cursor just left the inset?
        bool badcursor = false;
        if (&cursor().inset() != &cur.inset())
                badcursor = cursor().inset().notifyCursorLeaves(cursor());

        // do the dEPM magic if needed
        // FIXME: move this to InsetText::notifyCursorLeaves?
        if (!badcursor && cursor().inTexted())
                cursor().text()->deleteEmptyParagraphMechanism(cur, cursor());

        cursor() = cur;
        cursor().clearSelection();
        cursor().setTargetX();
        finishUndo();

}

so cur.bv().cursor() is set in mouseSetCursor. Is this enough? What could 
happen?

Meanwhile, I have committed the previous patch.

Jürgen

Reply via email to