diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-24 16:55:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-24 16:55:46 +0800 |
commit | 32db4f5cc960a2ea7b3080c99d7ba2a8aca31171 (patch) | |
tree | 4b80e79920def90475eaca7fc849e858fb415c3c /script/config.lua | |
parent | fc7dee5f8b8a143c2f0b4f286735cb22e3e6f58b (diff) | |
download | lua-language-server-32db4f5cc960a2ea7b3080c99d7ba2a8aca31171.zip |
enable invalid config
Diffstat (limited to 'script/config.lua')
-rw-r--r-- | script/config.lua | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/script/config.lua b/script/config.lua index 107f874b..92ed0491 100644 --- a/script/config.lua +++ b/script/config.lua @@ -182,22 +182,26 @@ function m.setConfig(config, other) local region = ConfigTemplate[c] if region then local info = region[k] - local suc, v = info[2](v) - if suc then - m.config[c][k] = v - else - m.config[c][k] = info[1] + if info then + local suc, v = info[2](v) + if suc then + m.config[c][k] = v + else + m.config[c][k] = info[1] + end end end end end for k, v in pairs(other) do local info = OtherTemplate[k] - local suc, v = info[2](v) - if suc then - m.other[k] = v - else - m.other[k] = info[1] + if info then + local suc, v = info[2](v) + if suc then + m.other[k] = v + else + m.other[k] = info[1] + end end end log.debug('Config update: ', util.dump(m.config), util.dump(m.other)) |