mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-07 07:30:20 +09:00
Merge pull request #1 from zyedidia/master
Sync repos for updating ASM syntax
This commit is contained in:
@@ -44,6 +44,15 @@ func PostActionCall(funcName string, view *View) bool {
|
||||
return relocate
|
||||
}
|
||||
|
||||
func (v *View) deselect(index int) bool {
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[index]
|
||||
v.Cursor.ResetSelection()
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
// Center centers the view on the cursor
|
||||
func (v *View) Center(usePlugin bool) bool {
|
||||
if usePlugin && !PreActionCall("Center", v) {
|
||||
@@ -70,10 +79,7 @@ func (v *View) CursorUp(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[0]
|
||||
v.Cursor.ResetSelection()
|
||||
}
|
||||
v.deselect(0)
|
||||
v.Cursor.Up()
|
||||
|
||||
if usePlugin {
|
||||
@@ -88,10 +94,7 @@ func (v *View) CursorDown(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[1]
|
||||
v.Cursor.ResetSelection()
|
||||
}
|
||||
v.deselect(1)
|
||||
v.Cursor.Down()
|
||||
|
||||
if usePlugin {
|
||||
@@ -290,6 +293,8 @@ func (v *View) StartOfLine(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v.deselect(0)
|
||||
|
||||
v.Cursor.Start()
|
||||
|
||||
if usePlugin {
|
||||
@@ -304,6 +309,8 @@ func (v *View) EndOfLine(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v.deselect(0)
|
||||
|
||||
v.Cursor.End()
|
||||
|
||||
if usePlugin {
|
||||
@@ -369,6 +376,8 @@ func (v *View) CursorEnd(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v.deselect(0)
|
||||
|
||||
v.Cursor.Loc = v.Buf.End()
|
||||
|
||||
if usePlugin {
|
||||
@@ -1089,6 +1098,8 @@ func (v *View) CursorPageUp(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v.deselect(0)
|
||||
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[0]
|
||||
v.Cursor.ResetSelection()
|
||||
@@ -1107,6 +1118,8 @@ func (v *View) CursorPageDown(usePlugin bool) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
v.deselect(0)
|
||||
|
||||
if v.Cursor.HasSelection() {
|
||||
v.Cursor.Loc = v.Cursor.CurSelection[1]
|
||||
v.Cursor.ResetSelection()
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
syntax "ini" "\.(ini|desktop|lfl|override)$" "(mimeapps\.list|pinforc|setup\.cfg)$" "weechat/.+\.conf$"
|
||||
header "^\[[A-Za-z]+\]$"
|
||||
|
||||
color brightcyan "\<(true|false)\>"
|
||||
color cyan "^[[:space:]]*[^=]*="
|
||||
color brightmagenta "^[[:space:]]*\[.*\]$"
|
||||
color red "[=;]"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color ,green "[[:space:]]+$"
|
||||
color ,red " + +| + +"
|
||||
color constant "\b(true|false)\b"
|
||||
color identifier "^[[:space:]]*[^=]*="
|
||||
color special "^[[:space:]]*\[.*\]$"
|
||||
color statement "[=;]"
|
||||
color comment "(^|[[:space:]])#([^{].*)?$"
|
||||
color constant.string ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
|
||||
Reference in New Issue
Block a user