mirror of
https://github.com/Hopiu/micro.git
synced 2026-05-22 21:25:49 +00:00
parent
3deee51537
commit
bd0fa7b6c2
1 changed files with 13 additions and 0 deletions
|
|
@ -54,6 +54,7 @@ var bindingActions = map[string]func(*View) bool{
|
||||||
"Cut": (*View).Cut,
|
"Cut": (*View).Cut,
|
||||||
"CutLine": (*View).CutLine,
|
"CutLine": (*View).CutLine,
|
||||||
"DuplicateLine": (*View).DuplicateLine,
|
"DuplicateLine": (*View).DuplicateLine,
|
||||||
|
"DeleteLine": (*View).DeleteLine,
|
||||||
"Paste": (*View).Paste,
|
"Paste": (*View).Paste,
|
||||||
"SelectAll": (*View).SelectAll,
|
"SelectAll": (*View).SelectAll,
|
||||||
"OpenFile": (*View).OpenFile,
|
"OpenFile": (*View).OpenFile,
|
||||||
|
|
@ -859,6 +860,18 @@ func (v *View) DuplicateLine() bool {
|
||||||
return true
|
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
|
// Paste whatever is in the system clipboard into the buffer
|
||||||
// Delete and paste if the user has a selection
|
// Delete and paste if the user has a selection
|
||||||
func (v *View) Paste() bool {
|
func (v *View) Paste() bool {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue