diff --git a/qutebrowser/completion/models/configmodel.py b/qutebrowser/completion/models/configmodel.py index ffa9bf4db..bb1f16758 100644 --- a/qutebrowser/completion/models/configmodel.py +++ b/qutebrowser/completion/models/configmodel.py @@ -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. diff --git a/qutebrowser/config/configcommands.py b/qutebrowser/config/configcommands.py index a97e8bc78..0b2a18866 100644 --- a/qutebrowser/config/configcommands.py +++ b/qutebrowser/config/configcommands.py @@ -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.