// Options with validators
var optionValidators = map[string]optionValidator{
- // "autosave": validateNonNegativeValue,
+ "autosave": validateNonNegativeValue,
"tabsize": validatePositiveValue,
"scrollmargin": validateNonNegativeValue,
"scrollspeed": validateNonNegativeValue,
if err != nil {
return errors.New("Error reading settings.json: " + err.Error())
}
+
+ // check if autosave is a boolean and convert it to float if so
+ if v, ok := parsedSettings["autosave"]; ok {
+ s, ok := v.(bool)
+ if ok {
+ if s {
+ parsedSettings["autosave"] = 8.0
+ } else {
+ parsedSettings["autosave"] = 0.0
+ }
+ }
+ }
}
}
return nil
"basename": false,
"colorcolumn": float64(0),
"cursorline": true,
+ "diffgutter": false,
"encoding": "utf-8",
"eofnewline": false,
"fastdirty": true,
// a list of settings that should only be globally modified and their
// default values
var defaultGlobalSettings = map[string]interface{}{
- // "autosave": float64(0),
+ "autosave": float64(0),
"colorscheme": "default",
"infobar": true,
"keymenu": false,