]> git.lizzy.rs Git - micro.git/commitdiff
Copy selection to primary on mouse release
authorZachary Yedidia <zyedidia@gmail.com>
Thu, 5 Mar 2020 21:00:40 +0000 (16:00 -0500)
committerZachary Yedidia <zyedidia@gmail.com>
Thu, 5 Mar 2020 21:00:40 +0000 (16:00 -0500)
Fixes #1558

internal/action/bufpane.go

index a7a7d91b21a3840f9739d468f52284605c48768a..91e2040ec89b90036d9ab57786631449cbff0f4f 100644 (file)
@@ -343,10 +343,11 @@ func (h *BufPane) HandleEvent(event tcell.Event) {
                                // release the mouse
 
                                // if !h.doubleClick && !h.tripleClick {
-                               //      h.Cursor.Loc = mouseLoc
                                //      h.Cursor.SetSelectionEnd(h.Cursor.Loc)
-                               //      h.Cursor.CopySelection("primary")
                                // }
+                               if h.Cursor.HasSelection() {
+                                       h.Cursor.CopySelection("primary")
+                               }
                                h.mouseReleased = true
                        }
                }