From 527750b68d86939bd265ba9c20eefde52ac934e1 Mon Sep 17 00:00:00 2001 From: Zachary Yedidia Date: Thu, 5 Mar 2020 16:00:40 -0500 Subject: [PATCH] Copy selection to primary on mouse release Fixes #1558 --- internal/action/bufpane.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index a7a7d91b..91e2040e 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -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 } }