diff --git a/internal/action/actions.go b/internal/action/actions.go index 658e6c41..222e83a8 100644 --- a/internal/action/actions.go +++ b/internal/action/actions.go @@ -1164,20 +1164,18 @@ func (h *BufPane) Redo() bool { // Copy the selection to the system clipboard func (h *BufPane) Copy() bool { - if h.Cursor.HasSelection() { - h.Cursor.CopySelection(clipboard.ClipboardReg) - h.freshClip = true - InfoBar.Message("Copied selection") + if !h.Cursor.HasSelection() { + return false } + h.Cursor.CopySelection(clipboard.ClipboardReg) + h.freshClip = true + InfoBar.Message("Copied selection") h.Relocate() return true } // CopyLine copies the current line to the clipboard func (h *BufPane) CopyLine() bool { - if h.Cursor.HasSelection() { - return false - } origLoc := h.Cursor.Loc origLastVisualX := h.Cursor.LastVisualX h.Cursor.SelectLine() diff --git a/internal/action/defaults_darwin.go b/internal/action/defaults_darwin.go index e1a54b79..21d6d2b4 100644 --- a/internal/action/defaults_darwin.go +++ b/internal/action/defaults_darwin.go @@ -45,7 +45,7 @@ var bufdefaults = map[string]string{ "Alt-]": "DiffNext|CursorEnd", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-d": "DuplicateLine", @@ -144,7 +144,7 @@ var infodefaults = map[string]string{ "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste", diff --git a/internal/action/defaults_other.go b/internal/action/defaults_other.go index a932688a..0e6a54b5 100644 --- a/internal/action/defaults_other.go +++ b/internal/action/defaults_other.go @@ -48,7 +48,7 @@ var bufdefaults = map[string]string{ "Alt-]": "DiffNext|CursorEnd", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-d": "DuplicateLine", @@ -147,7 +147,7 @@ var infodefaults = map[string]string{ "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste", diff --git a/runtime/help/keybindings.md b/runtime/help/keybindings.md index 17f9ab35..8926a542 100644 --- a/runtime/help/keybindings.md +++ b/runtime/help/keybindings.md @@ -491,7 +491,7 @@ conventions for text editing defaults. "Alt-]": "DiffNext|CursorEnd", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-d": "DuplicateLine", @@ -615,7 +615,7 @@ are given below: "Backtab": "CycleAutocompleteBack", "Ctrl-z": "Undo", "Ctrl-y": "Redo", - "Ctrl-c": "CopyLine|Copy", + "Ctrl-c": "Copy|CopyLine", "Ctrl-x": "Cut", "Ctrl-k": "CutLine", "Ctrl-v": "Paste",