mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 05:47:06 +09:00
Disable early validation of colorscheme option
Adding early validation of options in ReadSettings() caused a regression: colorschemes registered by plugins via config.AddRuntimeFile() stopped working, since ReadSettings() is called when plugins are not initialized (or even loaded) yet, so a colorscheme is not registered yet and thus its validation fails. Fix that with an ad-hoc fix: treat the "colorscheme" option as a special case and do not verify it early when reading settings.json, postponing that until the moment when we try to load this colorscheme.
This commit is contained in:
@@ -55,6 +55,14 @@ func InitColorscheme() error {
|
||||
c, err := LoadDefaultColorscheme()
|
||||
if err == nil {
|
||||
Colorscheme = c
|
||||
} else {
|
||||
// The colorscheme setting seems broken (maybe because we have not validated
|
||||
// it earlier, see comment in verifySetting()). So reset it to the default
|
||||
// colorscheme and try again.
|
||||
GlobalSettings["colorscheme"] = DefaultGlobalOnlySettings["colorscheme"]
|
||||
if c, err2 := LoadDefaultColorscheme(); err2 == nil {
|
||||
Colorscheme = c
|
||||
}
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user