This happens with Copy&Paste:
1) Create a note
2) Collapse it
3) Place the mouse cursor over the inset button.
4) Select the inset with the keyboard
5) type Ctrl-v immediately followed by Ctrl-v. The note inset is then
replaced by its own copy.
6) move the inset out of the inset

I find a simple solution to this: reset last_inset_ for each update.
Since I do not imagine any bad side effect of this change, I have
committed the change.

Bo

Index: src/BufferView.C
===================================================================
--- src/BufferView.C    (revision 16484)
+++ src/BufferView.C    (working copy)
@@ -335,6 +335,10 @@

 bool BufferView::update(Update::flags flags)
{
+       // last_inset_ points to the last visited inset. This pointer may become
+       // invalid becuase of keyboard editing. Since all such operations
+       // causes screen update(), I reset last_inset_ to avoid such a problem.
+       last_inset_ = 0;
       // This is close to a hot-path.
       if (lyxerr.debugging(Debug::DEBUG)) {
               lyxerr[Debug::DEBUG]

Reply via email to