In text3.C

        case LFUN_MOUSE_PRESS: {
                // Middle button press pastes if we have a selection
                // We do this here as if the selection was inside an inset
                // it could get cleared on the unlocking of the inset so
                // we have to check this first
                bool paste_internally = false;
                if (cmd.button() == mouse_button::button2 && cur.selection()) {
                        bv->owner()->dispatch(FuncRequest(LFUN_COPY));
                        paste_internally = true;
                }

                bv->mouseSetCursor(cur);
                // Insert primary selection with middle mouse
                // if there is a local selection in the current buffer,
                // insert this
                if (cmd.button() == mouse_button::button2) {
                        if (paste_internally)
                                bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
                        else
                        
bv->owner()->dispatch(FuncRequest(LFUN_PRIMARY_SELECTION_PASTE,
"paragraph"));


We can see that we do have paste_internally. I see two problems here:

1. paste_internal copies selection to internal clipboard. This means
selection will not change CLIPBOARD, only SELECTION. However, if a
user uses middle button paste, CLIPBOARD will be set as well.

2. "selection, left button at another location, middle button paste"
does not work. This works in emacs, as well as kate.

I guess 1 is easier to solve than 2...

Cheers,
Bo

Reply via email to