if (!cur.selection())
return;
+ // copySelection can not yet handle the case of cross idx selection
+ if (cur.selBegin().idx() != cur.selEnd().idx())
+ return;
+
if (cur.inTexted()) {
Text * text = cur.text();
BOOST_ASSERT(text);
&& cur.boundary() == oldBoundary) {
cur.undispatched();
cmd = FuncRequest(LFUN_FINISHED_RIGHT);
- }
- if (cur.selection())
+ } else if (cur.selection())
saveSelection(cur);
break;
cell(cur.idx())->dispatch(cur, cmd);
if (!cur.result().dispatched()) {
isRightToLeft(cur) ? movePrevCell(cur) : moveNextCell(cur);
- if (cmd.action == LFUN_CHAR_FORWARD_SELECT)
+ // The second case happens when LFUN_CHAR_FORWARD_SELECT
+ // is called, but the cursor is undispatched with cmd modified
+ // to LFUN_FINISHED_RIGHT (e.g. a case in bug 3782)
+ if (cmd.action == LFUN_CHAR_FORWARD_SELECT ||
+ cmd.action == LFUN_FINISHED_RIGHT)
saveSelection(cur);
if (sl == cur.top())
cmd = FuncRequest(LFUN_FINISHED_RIGHT);