Only show customized options for :config-unset completion

This commit is contained in:
Florian Bruhin 2017-10-05 18:40:14 +02:00
parent 2c9003fd4b
commit 2651688ef4
2 changed files with 11 additions and 1 deletions

View File

@ -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.

View File

@ -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.