mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-10 17:10:19 +09:00
@@ -54,6 +54,7 @@ var bindingActions = map[string]func(*View) bool{
|
||||
"Cut": (*View).Cut,
|
||||
"CutLine": (*View).CutLine,
|
||||
"DuplicateLine": (*View).DuplicateLine,
|
||||
"DeleteLine": (*View).DeleteLine,
|
||||
"Paste": (*View).Paste,
|
||||
"SelectAll": (*View).SelectAll,
|
||||
"OpenFile": (*View).OpenFile,
|
||||
@@ -859,6 +860,18 @@ func (v *View) DuplicateLine() bool {
|
||||
return true
|
||||
}
|
||||
|
||||
// DeleteLine deletes the current line
|
||||
func (v *View) DeleteLine() bool {
|
||||
v.Cursor.SelectLine()
|
||||
if !v.Cursor.HasSelection() {
|
||||
return false
|
||||
}
|
||||
v.Cursor.DeleteSelection()
|
||||
v.Cursor.ResetSelection()
|
||||
messenger.Message("Deleted line")
|
||||
return true
|
||||
}
|
||||
|
||||
// Paste whatever is in the system clipboard into the buffer
|
||||
// Delete and paste if the user has a selection
|
||||
func (v *View) Paste() bool {
|
||||
|
||||
Reference in New Issue
Block a user