diff --git a/internal/action/actions.go b/internal/action/actions.go index 9e9cb8b8..89821beb 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -1188,7 +1188,7 @@ func (h *BufPane) Copy() bool { return false } h.Cursor.CopySelection(clipboard.ClipboardReg) - h.freshClip = true + h.freshClip = false InfoBar.Message("Copied selection") h.Relocate() return true @@ -1206,7 +1206,7 @@ func (h *BufPane) CopyLine() bool { return false } h.Cursor.CopySelection(clipboard.ClipboardReg) - h.freshClip = true + h.freshClip = false if nlines > 1 { InfoBar.Message(fmt.Sprintf("Copied %d lines", nlines)) } else { @@ -1228,7 +1228,7 @@ func (h *BufPane) Cut() bool { h.Cursor.CopySelection(clipboard.ClipboardReg) h.Cursor.DeleteSelection() h.Cursor.ResetSelection() - h.freshClip = true + h.freshClip = false InfoBar.Message("Cut selection") h.Relocate() @@ -1251,7 +1251,7 @@ func (h *BufPane) CutLine() bool { totalLines = strings.Count(clip, "\n") + nlines } } else { - h.Copy() + h.Cursor.CopySelection(clipboard.ClipboardReg) } h.freshClip = true h.lastCutTime = time.Now() diff --git a/internal/action/bufpane.go b/internal/action/bufpane.go index 7b348b79..6a9e0e09 100644 --- a/internal/action/bufpane.go +++ b/internal/action/bufpane.go @@ -235,7 +235,8 @@ type BufPane struct { // It is used for clearing the clipboard to replace it with fresh cut lines. lastCutTime time.Time - // freshClip returns true if the clipboard has never been pasted. + // freshClip returns true if one or more lines have been cut to the clipboard + // and have never been pasted yet. freshClip bool // Was the last mouse event actually a double click?