mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-28 22:08:12 +09:00
Remove local settings
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package action
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@@ -296,7 +295,6 @@ func (h *BufPane) DoKeyEvent(e Event) bool {
|
||||
return false
|
||||
}
|
||||
rel := action(h)
|
||||
log.Println("calling on", estr)
|
||||
if h.PluginCB("on"+estr) && rel {
|
||||
h.Relocate()
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ package action
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"regexp"
|
||||
@@ -271,9 +270,7 @@ func ReloadConfig() {
|
||||
screen.TermMessage(err)
|
||||
}
|
||||
|
||||
log.Println("RELOAD CONFIG", len(buffer.OpenBuffers))
|
||||
for _, b := range buffer.OpenBuffers {
|
||||
log.Println("UPDATE RULES")
|
||||
b.UpdateRules()
|
||||
}
|
||||
}
|
||||
@@ -450,7 +447,7 @@ func (h *BufPane) ResetCmd(args []string) {
|
||||
option := args[0]
|
||||
|
||||
defaultGlobals := config.DefaultGlobalSettings()
|
||||
defaultLocals := config.DefaultLocalSettings()
|
||||
defaultLocals := config.DefaultCommonSettings()
|
||||
|
||||
if _, ok := defaultGlobals[option]; ok {
|
||||
SetGlobalOptionNative(option, defaultGlobals[option])
|
||||
|
||||
@@ -92,17 +92,16 @@ func OptionComplete(b *buffer.Buffer) ([]string, []string) {
|
||||
input, argstart := buffer.GetArg(b)
|
||||
|
||||
var suggestions []string
|
||||
localSettings := config.DefaultLocalSettings()
|
||||
for option := range config.GlobalSettings {
|
||||
if strings.HasPrefix(option, input) {
|
||||
suggestions = append(suggestions, option)
|
||||
}
|
||||
}
|
||||
for option := range localSettings {
|
||||
if strings.HasPrefix(option, input) && !contains(suggestions, option) {
|
||||
suggestions = append(suggestions, option)
|
||||
}
|
||||
}
|
||||
// for option := range localSettings {
|
||||
// if strings.HasPrefix(option, input) && !contains(suggestions, option) {
|
||||
// suggestions = append(suggestions, option)
|
||||
// }
|
||||
// }
|
||||
|
||||
sort.Strings(suggestions)
|
||||
completions := make([]string, len(suggestions))
|
||||
@@ -122,19 +121,19 @@ func OptionValueComplete(b *buffer.Buffer) ([]string, []string) {
|
||||
completeValue := false
|
||||
args := bytes.Split(l, []byte{' '})
|
||||
if len(args) >= 2 {
|
||||
localSettings := config.DefaultLocalSettings()
|
||||
// localSettings := config.DefaultLocalSettings()
|
||||
for option := range config.GlobalSettings {
|
||||
if option == string(args[len(args)-2]) {
|
||||
completeValue = true
|
||||
break
|
||||
}
|
||||
}
|
||||
for option := range localSettings {
|
||||
if option == string(args[len(args)-2]) {
|
||||
completeValue = true
|
||||
break
|
||||
}
|
||||
}
|
||||
// for option := range localSettings {
|
||||
// if option == string(args[len(args)-2]) {
|
||||
// completeValue = true
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
}
|
||||
if !completeValue {
|
||||
return OptionComplete(b)
|
||||
@@ -144,18 +143,18 @@ func OptionValueComplete(b *buffer.Buffer) ([]string, []string) {
|
||||
|
||||
inputOpt = strings.TrimSpace(inputOpt)
|
||||
var suggestions []string
|
||||
localSettings := config.DefaultLocalSettings()
|
||||
// localSettings := config.DefaultLocalSettings()
|
||||
var optionVal interface{}
|
||||
for k, option := range config.GlobalSettings {
|
||||
if k == inputOpt {
|
||||
optionVal = option
|
||||
}
|
||||
}
|
||||
for k, option := range localSettings {
|
||||
if k == inputOpt {
|
||||
optionVal = option
|
||||
}
|
||||
}
|
||||
// for k, option := range localSettings {
|
||||
// if k == inputOpt {
|
||||
// optionVal = option
|
||||
// }
|
||||
// }
|
||||
|
||||
switch optionVal.(type) {
|
||||
case bool:
|
||||
|
||||
Reference in New Issue
Block a user