mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-25 18:07:07 +09:00
@@ -1083,7 +1083,9 @@ func (h *BufPane) Cut() bool {
|
|||||||
|
|
||||||
// DuplicateLine duplicates the current line or selection
|
// DuplicateLine duplicates the current line or selection
|
||||||
func (h *BufPane) DuplicateLine() bool {
|
func (h *BufPane) DuplicateLine() bool {
|
||||||
|
var infoMessage = "Duplicated line"
|
||||||
if h.Cursor.HasSelection() {
|
if h.Cursor.HasSelection() {
|
||||||
|
infoMessage = "Duplicated selection"
|
||||||
h.Buf.Insert(h.Cursor.CurSelection[1], string(h.Cursor.GetSelection()))
|
h.Buf.Insert(h.Cursor.CurSelection[1], string(h.Cursor.GetSelection()))
|
||||||
} else {
|
} else {
|
||||||
h.Cursor.End()
|
h.Cursor.End()
|
||||||
@@ -1091,7 +1093,7 @@ func (h *BufPane) DuplicateLine() bool {
|
|||||||
// h.Cursor.Right()
|
// h.Cursor.Right()
|
||||||
}
|
}
|
||||||
|
|
||||||
InfoBar.Message("Duplicated line")
|
InfoBar.Message(infoMessage)
|
||||||
h.Relocate()
|
h.Relocate()
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user