From ef2de8201a7f06c2f5ca8079af40beeb1fa8951f Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Mon, 18 Dec 2017 07:58:26 -0500 Subject: [PATCH] Fix colors.completion.fg default and description. Update the description to mention the number of columns and change the default to ["white", "white", "white"] to make it more obvious that multiple colors can be specified. This also satisfies the config test that expects the default value for ListOrValue types to be a list. One other test had to be tweaked to use a config option that is still just a QtColor rather than a ListOrValue. While it is possible to provide just two colors, it is "undefined behavior". It will use the first color as the third color, but that is an artifact of the implementation and therefore not documented (though also not an error, as it is harmless). --- qutebrowser/config/configdata.yml | 6 +++--- tests/unit/config/test_config.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 6d8812c25..aca0311fd 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1540,15 +1540,15 @@ zoom.text_only: ## colors colors.completion.fg: - default: white + default: ["white", "white", "white"] type: name: ListOrValue valtype: QtColor desc: >- Text color of the completion widget. - May be a single value to specify the color for all columns, or a list - specifying a different color for each column. + May be a single color to use for all columns or a list of three colors, + one for each column. colors.completion.odd.bg: default: '#444444' diff --git a/tests/unit/config/test_config.py b/tests/unit/config/test_config.py index 93686e600..d8bf73700 100644 --- a/tests/unit/config/test_config.py +++ b/tests/unit/config/test_config.py @@ -400,7 +400,7 @@ class TestConfig: assert not conf._mutables def test_get_obj_simple(self, conf): - assert conf.get_obj('colors.completion.fg') == 'white' + assert conf.get_obj('colors.completion.category.fg') == 'white' @pytest.mark.parametrize('option', ['content.headers.custom', 'keyhint.blacklist',