Only show customized options for :config-unset completion
This commit is contained in:
parent
2c9003fd4b
commit
2651688ef4
@ -33,6 +33,16 @@ def option(*, info):
|
||||
return model
|
||||
|
||||
|
||||
def customized_option(*, info):
|
||||
"""A CompletionModel filled with set settings and their descriptions."""
|
||||
model = completionmodel.CompletionModel(column_widths=(20, 70, 10))
|
||||
options = ((opt.name, opt.description, info.config.get_str(opt.name))
|
||||
for opt, _value in info.config)
|
||||
model.add_category(listcategory.ListCategory("Customized options",
|
||||
sorted(options)))
|
||||
return model
|
||||
|
||||
|
||||
def value(optname, *_values, info):
|
||||
"""A CompletionModel filled with setting values.
|
||||
|
||||
|
@ -177,7 +177,7 @@ class ConfigCommands:
|
||||
self._print_value(option)
|
||||
|
||||
@cmdutils.register(instance='config-commands')
|
||||
@cmdutils.argument('option', completion=configmodel.option)
|
||||
@cmdutils.argument('option', completion=configmodel.customized_option)
|
||||
def config_unset(self, option, temp=False):
|
||||
"""Unset an option.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user