mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-07 05:10:23 +09:00
Merge
This commit is contained in:
@@ -71,6 +71,7 @@ func InitBindings() {
|
||||
"EndOfLine": (*View).EndOfLine,
|
||||
"ToggleRuler": (*View).ToggleRuler,
|
||||
"JumpLine": (*View).JumpLine,
|
||||
"ClearStatus": (*View).ClearStatus,
|
||||
}
|
||||
|
||||
keys := map[string]Key{
|
||||
@@ -294,6 +295,7 @@ func DefaultBindings() map[string]string {
|
||||
"CtrlR": "ToggleRuler",
|
||||
"CtrlL": "JumpLine",
|
||||
"Delete": "Delete",
|
||||
"Esc": "ClearStatus",
|
||||
}
|
||||
}
|
||||
|
||||
@@ -847,6 +849,12 @@ func (v *View) JumpLine() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// ClearStatus clears the messenger bar
|
||||
func (v *View) ClearStatus() bool {
|
||||
messenger.Message("")
|
||||
return false
|
||||
}
|
||||
|
||||
// None is no action
|
||||
func None() bool {
|
||||
return false
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -84,6 +84,9 @@ func Search(searchStr string, v *View, down bool) {
|
||||
str = text[:searchStart]
|
||||
}
|
||||
r, err := regexp.Compile(searchStr)
|
||||
if settings["ignorecase"].(bool) {
|
||||
r, err = regexp.Compile("(?i)" + searchStr)
|
||||
}
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ func DefaultSettings() map[string]interface{} {
|
||||
"colorscheme": "default",
|
||||
"tabsize": float64(4),
|
||||
"indentchar": " ",
|
||||
"ignorecase": false,
|
||||
"autoindent": true,
|
||||
"syntax": true,
|
||||
"tabsToSpaces": false,
|
||||
|
||||
@@ -182,6 +182,10 @@ Here are the options that you can set:
|
||||
|
||||
default value: ` `
|
||||
|
||||
* `ignorecase`: perform case-insensitive searches
|
||||
|
||||
default value: `off`
|
||||
|
||||
* `syntax`: turns syntax on or off
|
||||
|
||||
default value: `on`
|
||||
|
||||
4
runtime/syntax/Makefile
Normal file
4
runtime/syntax/Makefile
Normal file
@@ -0,0 +1,4 @@
|
||||
export
|
||||
:=
|
||||
error
|
||||
|
||||
@@ -1,22 +1,20 @@
|
||||
syntax "Makefile" "([Mm]akefile|\.ma?k)$"
|
||||
header "^#!.*/(env +)?[bg]?make( |$)"
|
||||
|
||||
color cyan "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>"
|
||||
color cyan "^(export|include|override)\>"
|
||||
color brightmagenta "^[^:= ]+:"
|
||||
color red "[=,%]" "\+=|\?=|:=|&&|\|\|"
|
||||
color brightblue "\$\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
|
||||
color brightblue "\$\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
|
||||
color brightblue "\$\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
|
||||
color brightblue "\$\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
|
||||
color brightblue "\$\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
|
||||
color black "[()$]"
|
||||
color yellow ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color brightyellow "\$+(\{[^} ]+\}|\([^) ]+\))"
|
||||
color brightyellow "\$[@^<*?%|+]|\$\([@^<*?%+-][DF]\)"
|
||||
color magenta "\$\$|\\.?"
|
||||
color brightblack "(^|[[:space:]])#([^{].*)?$"
|
||||
color brightblack "^ @#.*"
|
||||
|
||||
# Show trailing whitespace
|
||||
color ,green "[[:space:]]+$"
|
||||
color preproc "\<(ifeq|ifdef|ifneq|ifndef|else|endif)\>"
|
||||
color statement "^(export|include|override)\>"
|
||||
color operator "^[^:= ]+:"
|
||||
color operator "[=,%]" "\+=|\?=|:=|&&|\|\|"
|
||||
color statement "\$\((abspath|addprefix|addsuffix|and|basename|call|dir)[[:space:]]"
|
||||
color statement "\$\((error|eval|filter|filter-out|findstring|firstword)[[:space:]]"
|
||||
color statement "\$\((flavor|foreach|if|info|join|lastword|notdir|or)[[:space:]]"
|
||||
color statement "\$\((origin|patsubst|realpath|shell|sort|strip|suffix)[[:space:]]"
|
||||
color statement "\$\((value|warning|wildcard|word|wordlist|words)[[:space:]]"
|
||||
color identifier "^.+:"
|
||||
color identifier "[()$]"
|
||||
color constant ""(\\.|[^"])*"|'(\\.|[^'])*'"
|
||||
color identifier "\$+(\{[^} ]+\}|\([^) ]+\))"
|
||||
color identifier "\$[@^<*?%|+]|\$\([@^<*?%+-][DF]\)"
|
||||
color identifier "\$\$|\\.?"
|
||||
color comment "(^|[[:space:]])#([^{].*)?$"
|
||||
color comment "^ @#.*"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
## Here is an example for Bourne shell scripts.
|
||||
##
|
||||
syntax "SH" "\.sh$" "\.bash" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_profile" "bash_profile"
|
||||
syntax "SH" "\.sh$" "\.bash" "\.bashrc" "bashrc" "\.bash_aliases" "bash_aliases" "\.bash_functions" "bash_functions" "\.bash_profile" "bash_profile" "Pkgfile" "PKGBUILD" ".ebuild\$" "APKBUILD"
|
||||
header "^#!.*/(env +)?(ba)?sh( |$)"
|
||||
|
||||
color statement "\b(case|do|done|elif|else|esac|exit|fi|for|function|if|in|local|read|return|select|shift|then|time|until|while)\b"
|
||||
|
||||
Reference in New Issue
Block a user