Sorry Georg, it is too complicated to apply your patch. I guess you can simply commit.
{ LFUN_CHAR_FORWARD_SELECT, "forward-select", ReadOnly | SingleParUpdate }, + { LFUN_CLIPBOARD_PASTE, "clipboard-paste", Noop }, For C-v or menu paste only, right? + case LFUN_CLIPBOARD_PASTE: case LFUN_PRIMARY_SELECTION_PASTE: { - string const clip = cur.bv().owner()->gui().clipboard().get(); + string const clip = (cmd.action == LFUN_CLIPBOARD_PASTE) ? + cur.bv().owner()->gui().clipboard().get() : + cur.bv().owner()->gui().selection().get(); Why don't we handle these two actions separately? My understanding is that the first should be triggered by C-v, the second by middle-button. + return clipboard_; + return *selection_; + GuiClipboard clipboard_; + /// + boost::shared_ptr<GuiSelection> selection_; /// Is there a particular reason why clipboard is an object and selection is a pointer? + case LFUN_CLIPBOARD_PASTE: case LFUN_PRIMARY_SELECTION_PASTE: { cur.clearSelection(); - string const clip = bv->owner()->gui().clipboard().get(); + string const clip = (cmd.action == LFUN_CLIPBOARD_PASTE) ? + bv->owner()->gui().clipboard().get() : + bv->owner()->gui().selection().get(); If the body is not long, I still prefer separating these two actions, rather than telling them apart from cmd.action. Item "Copy" "copy" Item "Paste" "paste" Submenu "Paste Recent" "pasterecent" - Submenu "Paste External Selection" "edit_paste" + Submenu "Paste External Clipboard/Selection" "edit_paste" Separator I do not really like the external/internal clipboard. Is there any technique reason why can not they be merged? Ideally, we should have copy/cut/paste/select all etc for CLIPBAORD, and under *nix, we have the bonus of selection/middle button. The internal clipboard actually makes copy/paste between two lyx sessions impossible. Cheers, Bo