- if (cmd.button() == mouse_button::button1
- || (cmd.button() == mouse_button::button3
- && (&bvcur.selBegin().inset() != this || !tablemode(bvcur)))) {
- if (!bvcur.selection() && !cur.bv().mouseSetCursor(cur))
- cur.noUpdate();
- cur.selection() = false;
- setCursorFromCoordinates(cur, cmd.x, cmd.y);
- cur.bv().mouseSetCursor(cur);
- break;
- }
-
- if (cmd.button() == mouse_button::button2) {
- if (cap::selection()) {
- // See comment in Text::dispatch why we
- // do this
- // FIXME This does not use paste_tabular,
- // another reason why paste_tabular should go.
- cap::copySelectionToStack();
- cmd = FuncRequest(LFUN_PASTE, "0");
- } else {
- cmd = FuncRequest(LFUN_PRIMARY_SELECTION_PASTE,
- "paragraph");
- }
- doDispatch(cur, cmd);
- cur.bv().buffer()->markDirty();
- cur.bv().mouseSetCursor(cur);
- }
+ // do not reset cursor/selection if we have selected
+ // some cells (bug 2715).
+ if (cmd.button() == mouse_button::button3
+ && &bvcur.selBegin().inset() == this
+ && tablemode(bvcur))
+ ;
+ else
+ // Let InsetText do it
+ cell(cur.idx())->dispatch(cur, cmd);