mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-17 06:17:12 +09:00
config: Refactor parsed option handling
Validate the parsed options directly after read and inform about errors.
This commit is contained in:
@@ -9,6 +9,10 @@ import (
|
||||
)
|
||||
|
||||
func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
|
||||
if err := config.OptionIsValid(option, nativeValue); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if reflect.DeepEqual(b.Settings[option], nativeValue) {
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user