Add ignorecase option

This commit is contained in:
Camille Scholtz
2016-05-18 18:44:32 +02:00
parent 2a95d0b012
commit bfbfc50018
3 changed files with 9 additions and 1 deletions

View File

@@ -83,7 +83,10 @@ func Search(searchStr string, v *View, down bool) {
} else {
str = text[:searchStart]
}
r, err := regexp.Compile("(?i)" + searchStr)
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,

View File

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