mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-09 14:20:16 +09:00
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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user