mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-29 22:27:13 +09:00
implemented select line as an Action
This commit is contained in:
@@ -458,6 +458,20 @@ func (v *View) EndOfLine(usePlugin bool) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// SelectLine selects the entire current line
|
||||||
|
func (v *View) SelectLine(usePlugin bool) bool {
|
||||||
|
if usePlugin && !PreActionCall("SelectLine", v) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
v.Cursor.SelectLine()
|
||||||
|
|
||||||
|
if usePlugin {
|
||||||
|
return PostActionCall("SelectLine", v)
|
||||||
|
}
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
// SelectToStartOfLine selects to the start of the current line
|
// SelectToStartOfLine selects to the start of the current line
|
||||||
func (v *View) SelectToStartOfLine(usePlugin bool) bool {
|
func (v *View) SelectToStartOfLine(usePlugin bool) bool {
|
||||||
if usePlugin && !PreActionCall("SelectToStartOfLine", v) {
|
if usePlugin && !PreActionCall("SelectToStartOfLine", v) {
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ var bindingActions = map[string]func(*View, bool) bool{
|
|||||||
"SelectWordLeft": (*View).SelectWordLeft,
|
"SelectWordLeft": (*View).SelectWordLeft,
|
||||||
"DeleteWordRight": (*View).DeleteWordRight,
|
"DeleteWordRight": (*View).DeleteWordRight,
|
||||||
"DeleteWordLeft": (*View).DeleteWordLeft,
|
"DeleteWordLeft": (*View).DeleteWordLeft,
|
||||||
|
"SelectLine": (*View).SelectLine,
|
||||||
"SelectToStartOfLine": (*View).SelectToStartOfLine,
|
"SelectToStartOfLine": (*View).SelectToStartOfLine,
|
||||||
"SelectToEndOfLine": (*View).SelectToEndOfLine,
|
"SelectToEndOfLine": (*View).SelectToEndOfLine,
|
||||||
"ParagraphPrevious": (*View).ParagraphPrevious,
|
"ParagraphPrevious": (*View).ParagraphPrevious,
|
||||||
|
|||||||
@@ -156,6 +156,7 @@ MoveLinesUp
|
|||||||
MoveLinesDown
|
MoveLinesDown
|
||||||
DeleteWordRight
|
DeleteWordRight
|
||||||
DeleteWordLeft
|
DeleteWordLeft
|
||||||
|
SelectLine
|
||||||
SelectToStartOfLine
|
SelectToStartOfLine
|
||||||
SelectToEndOfLine
|
SelectToEndOfLine
|
||||||
InsertNewline
|
InsertNewline
|
||||||
|
|||||||
Reference in New Issue
Block a user