mirror of
https://github.com/zyedidia/micro.git
synced 2025-06-18 23:05:40 -04:00
Fix regression in CopyLine, CutLine, DeleteLine for last line (#3519)
Fix regression introduced in commit fdacb28962
("CopyLine, CutLine,
DeleteLine: respect selection"): when CopyLine, CutLine or DeleteLine is
done in the last line of the buffer and this line is not empty, this
line gets selected but does not get copied/cut/deleted (and worse, it
remains selected).
This commit is contained in:
parent
b3227d6049
commit
1ead9ce4fd
@ -1300,7 +1300,13 @@ func (h *BufPane) selectLines() int {
|
||||
} else {
|
||||
h.Cursor.SelectLine()
|
||||
}
|
||||
return h.Cursor.CurSelection[1].Y - h.Cursor.CurSelection[0].Y
|
||||
|
||||
nlines := h.Cursor.CurSelection[1].Y - h.Cursor.CurSelection[0].Y
|
||||
if nlines == 0 && h.Cursor.HasSelection() {
|
||||
// selected last line and it is not empty
|
||||
nlines++
|
||||
}
|
||||
return nlines
|
||||
}
|
||||
|
||||
// Copy the selection to the system clipboard
|
||||
|
Loading…
Reference in New Issue
Block a user