mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-24 17:50:15 +09:00
config: Refactor parsed option handling
Validate the parsed options directly after read and inform about errors.
This commit is contained in:
@@ -592,6 +592,10 @@ func doSetGlobalOptionNative(option string, nativeValue interface{}) error {
|
||||
}
|
||||
|
||||
func SetGlobalOptionNative(option string, nativeValue interface{}) error {
|
||||
if err := config.OptionIsValid(option, nativeValue); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// check for local option first...
|
||||
for _, s := range config.LocalSettings {
|
||||
if s == option {
|
||||
|
||||
Reference in New Issue
Block a user