This commit is contained in:
Zachary Yedidia
2016-05-20 09:19:28 -04:00
8 changed files with 156 additions and 115 deletions

View File

@@ -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

View File

@@ -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
}

View File

@@ -75,6 +75,7 @@ func DefaultSettings() map[string]interface{} {
"colorscheme": "default",
"tabsize": float64(4),
"indentchar": " ",
"ignorecase": false,
"autoindent": true,
"syntax": true,
"tabsToSpaces": false,