Fix CopyLine at the last empty line of buffer

When the cursor is at the last line of buffer and it is an empty line,
CopyLine does not copy this line, which is correct, but it shows a bogus
"Copied line" message. Fix this by adding a check for that, same as in
CutLine and DeleteLine.
This commit is contained in:
Dmytro Maluka
2024-06-09 01:46:46 +02:00
parent df8d5285bf
commit 8bc67569f9

View File

@@ -1181,6 +1181,9 @@ func (h *BufPane) CopyLine() bool {
origLoc := h.Cursor.Loc
origLastVisualX := h.Cursor.LastVisualX
h.Cursor.SelectLine()
if !h.Cursor.HasSelection() {
return false
}
h.Cursor.CopySelection(clipboard.ClipboardReg)
h.freshClip = true
InfoBar.Message("Copied line")