On 22.07.2016 12:42, racoon wrote:
On Ticket #6570, http://www.lyx.org/trac/ticket/6570.
The culprit here seems to be in
`Text3.cpp`:
{{{
static bool doInsertInset(Cursor & cur, Text * text,
FuncRequest const & cmd, bool edit, bool pastesel)
{
...
bool gotsel = false;
if (cur.selection()) {
cutSelection(cur, false, pastesel);
cur.clearSelection();
gotsel = true;
}
text->insertInset(cur, inset);
...
}
}}}
Maybe there are similar passages elsewhere that need to be fixed.
Removing `cutSelection(cur, false, pastesel);` seems to solve the
problem about overwritten clipboards. But then the current clipboard is
inserted into the inset and the current selection is not removed.
(I started with adding `eraseSelection(cur);` instead but it's
undefined. How does one add the definition from `CutAndPaste.cpp`?)
Okay, found out about the definition but it did nit help since
`eraseSelection` seems not to work in this context. ("Can't erase...")
Instead `cutSelection(cur, false, false);` seems to erase the text
without pushing it to the clipboard.
The next problem is of course that the pasting from the clipboard
on line 314:
{{{
pasteFromStack(cur, cur.buffer()->errorList("Paste"), 0);
}}}
Is there some stack on which one can put the selection and pasting it
later without using the clipboard?
Daniel