refactor(options): remove obsolete distinction of "vi" vs "vim" defaults

It might come as a schocking surprise, but the defaults we support
are the NEOVIM defaults.
This commit is contained in:
Björn Linse
2021-07-13 19:12:08 +02:00
parent fc869da6dc
commit f0cc3a9480
7 changed files with 98 additions and 439 deletions

View File

@@ -69,7 +69,6 @@ local get_flags = function(o)
{'alloced'},
{'nodefault'},
{'no_mkrc'},
{'vi_def'},
{'secure'},
{'gettext'},
{'noglob'},
@@ -119,8 +118,11 @@ local get_value = function(v)
return '(char_u *) ' .. value_dumpers[type(v)](v)
end
local get_defaults = function(d)
return ('{' .. get_value(d.vi) .. ', ' .. get_value(d.vim) .. '}')
local get_defaults = function(d,n)
if (d.vi == nil and d.vim == nil) or (d.vi ~= nil and d.vim ~= nil) then
error("option '"..n.."' should have one and only one default value")
end
return get_value(d.vim or d.vi)
end
local defines = {}
@@ -169,11 +171,11 @@ local dump_option = function(i, o)
if o.defaults.condition then
w(get_cond(o.defaults.condition))
end
w(' .def_val=' .. get_defaults(o.defaults.if_true))
w(' .def_val=' .. get_defaults(o.defaults.if_true, o.full_name))
if o.defaults.condition then
if o.defaults.if_false then
w('#else')
w(' .def_val=' .. get_defaults(o.defaults.if_false))
w(' .def_val=' .. get_defaults(o.defaults.if_false, o.full_name))
end
w('#endif')
end