Add option to disable use of a the primary clipboard

Closes #544
This commit is contained in:
Zachary Yedidia
2017-02-07 19:21:25 -05:00
parent 28af256be0
commit 5dc8fe40ca
4 changed files with 59 additions and 50 deletions

View File

@@ -32,7 +32,9 @@ func (c *Cursor) Goto(b Cursor) {
// CopySelection copies the user's selection to either "primary" or "clipboard"
func (c *Cursor) CopySelection(target string) {
if c.HasSelection() {
clipboard.WriteAll(c.GetSelection(), target)
if target != "primary" || c.buf.Settings["useprimary"].(bool) {
clipboard.WriteAll(c.GetSelection(), target)
}
}
}