]> git.lyx.org Git - features.git/blobdiff - src/text3.C
Fix and document middle mouse button paste. This is probably the last of
[features.git] / src / text3.C
index 1fdc5b736e075f8e2c59078cbb66d1e5372403ca..038354ea049d3222a27e7d0b14badf02c0072a17 100644 (file)
@@ -961,7 +961,14 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                // we have to check this first
                bool paste_internally = false;
                if (cmd.button() == mouse_button::button2 && cur.selection()) {
-                       lyx::dispatch(FuncRequest(LFUN_COPY));
+                       // Copy the selection to the clipboard stack. This
+                       // is done for two reasons:
+                       // - We want it to appear in the "Edit->Paste recent"
+                       //   menu.
+                       // - We can then use the normal copy/paste machinery
+                       //   instead of theSelection().get() to preserve
+                       //   formatting of the pasted stuff.
+                       cap::copySelectionToStack(cur.bv().cursor());
                        paste_internally = true;
                }