Commit Graph

154 Commits

Author SHA1 Message Date
Florian Bruhin
77fe2e1c85 Fix test_set_wrong_backend 2018-07-02 22:32:59 +02:00
Florian Bruhin
9941812127 Normalize keys read from the config
This makes sure the internal bindings.commands object only contains normalized
key sequences.

Fixes #3699
2018-03-12 08:00:56 +01:00
Florian Bruhin
482b622b1b Fix handling of empty bindings without breaking :unbind
1899e313fd as a fix for #3631 broke :unbind, as
the config system treats None and '' equally.

Instead, allow None/'' again, but just handle it as "no binding".
2018-03-08 11:42:27 +01:00
Florian Bruhin
34815f5cf8 Make bindings.default only settable in autoconfig.yml
Fixes #3131
2018-03-07 18:30:44 +01:00
Florian Bruhin
5a5873d4ee Rename KeyConfig._prepare to ._validate 2018-02-27 14:16:41 +01:00
Florian Bruhin
362f923f06 Fix lint 2018-02-27 09:34:55 +01:00
Florian Bruhin
49f8bc3d63 Use KeySequences correctly in test_config.py 2018-02-27 07:37:55 +01:00
Florian Bruhin
321d5c5d20 Merge branch 'master' into keys 2018-02-25 21:25:12 +01:00
Florian Bruhin
0d4e20c395 Whitelist config options which support URL patterns 2018-02-20 23:26:22 +01:00
Florian Bruhin
6c5876a494 Fix tests broken by urlmatch trailing slash change 2018-02-20 23:08:09 +01:00
Florian Bruhin
439d51875f Add config.pattern() 2018-02-20 20:54:26 +01:00
Florian Bruhin
9685445559 Fix issues with Python 3.5 2018-02-20 17:56:47 +01:00
Florian Bruhin
ae73215724 Fix lint 2018-02-20 12:30:41 +01:00
Florian Bruhin
05017c83d6 Add more config tests 2018-02-20 12:30:34 +01:00
Florian Bruhin
5978b7b35f config: Improve tests for non-existent options 2018-02-19 22:09:54 +01:00
Florian Bruhin
463320b599 Make test_config.py work 2018-02-19 22:09:54 +01:00
Florian Bruhin
fecebd6ced Start getting test_config.py to run 2018-02-19 22:09:49 +01:00
Florian Bruhin
1a88b64c67 Add a test for keyconfig.get_command(..., default=True) 2018-02-08 21:53:41 +01:00
Florian Bruhin
6f028e9ad0 Update copyright years 2018-02-05 12:19:50 +01:00
Florian Bruhin
dcf89f7a28 Fix KeyConfig._prepare 2017-12-29 16:10:12 +01:00
Ryan Roden-Corrent
ef2de8201a 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).
2017-12-18 08:42:22 -05:00
Ryan Roden-Corrent
31c2988693 Fix test_config.test_get for updated config.
colors.completion.fg is now a list instead of a QColor. As this test
specifically wanted to test a QColor, I just changed it to a different
config option.
2017-12-17 13:28:00 -05:00
Ryan Farley
5ed8019115 update flake8 and flake8-deprecated
Updated requirements and adjusted the configuration in `.flake8`; other
files have been modified where the lack of per-file auto-ignore caused
problems, where putty's `# flake8: disable=` syntax could be replaced
with a simpler `noqa`, or where pylint directives already suppressed the
same error.
2017-11-26 00:16:14 -06:00
Jay Kamat
e00a072d15
Fix garbage collection of StyleSheetObserver objects 2017-11-10 23:25:46 -05:00
cryzed
6e719d1796 Fix issue #3251 2017-11-08 15:08:36 +01:00
Florian Bruhin
5689a3c0dc Fix unbinding default keys twice
When doing :unbind with a default keybinding the first time, it gets inserted
into bindings.commands with None as value.

When then doing :unbind a second time, instead of just leaving that None value
as-is, we removed it again (because it got treated as a custom binding).

Fixes #3162
2017-11-04 15:17:19 +01:00
Florian Bruhin
36ef68c698 Add :bind --default
Closes #3059
2017-10-08 21:48:48 +02:00
Florian Bruhin
c63d16e2ea tests: Get rid of duplicate key config stubs 2017-10-05 11:22:54 +02:00
Florian Bruhin
da4402e98c Don't rely on order in test_clear 2017-10-04 09:02:34 +02:00
Florian Bruhin
22088d9f7b Remove --force for :bind and config.bind(...)
Turns out --force is just in the way for most people, and at least for default
bindings it's easy to reset them.

Also, it makes :config-source fail when config.py contains keybindings.

Closes #3049
2017-10-03 20:43:38 +02:00
Florian Bruhin
999d70ae40 Add missing config.py tests 2017-10-03 14:13:10 +02:00
Florian Bruhin
9383452ab9 Use a real YAML config for config tests 2017-10-03 13:06:50 +02:00
Florian Bruhin
ed8c3f4aa2 Add :config-clear and :config-unset
See #2794
2017-10-03 12:45:39 +02:00
Florian Bruhin
a8fc561707 Split config commands off to their own file. 2017-10-02 07:08:30 +02:00
Florian Bruhin
a273baf8a0 Make sure :bind/unbind works properly when bindings.commands is None
To make this work, we should never return None when trying to get bindings to
modify.

Fixes #3026
2017-10-01 21:43:00 +02:00
Florian Bruhin
38038df703 Compare objects with :set with multiple values 2017-09-25 21:24:12 +02:00
Florian Bruhin
d5a1fff637 Move init stuff from config.py to configinit.py
Closes #2997
2017-09-22 14:11:54 +02:00
Florian Bruhin
64b783d9c0 Do not validate commands in the config and with :bind
There are just way too many gotchas related to valid modes, aliases, and
circular dependencies when validating aliases/bindings in the config.

Let's just remove this and let invalid commands fail late, when they're actually
used.
2017-09-21 22:30:48 +02:00
Florian Bruhin
32b2b3dfd9 Add test for invalid value type in YAML file 2017-09-21 21:15:37 +02:00
Florian Bruhin
b1ddb9a6df Remove confusing test
That's not the behavior we actually have in the config anymore when using
conf._yaml.load().
2017-09-21 20:27:45 +02:00
Florian Bruhin
7cad8f41f2 Remove unknown YAML data from config
I considered introducing another list of deleted options (or a "deleted: True"
in configdata.yml), similar to what we had with the old config.

However, let's take the easier route and just delete everything we don't know
from configdata.yml. If someone edits it by hand, it's their fault :P

See #2772, #2847
2017-09-21 16:29:40 +02:00
Florian Bruhin
fb33985f07 Merge remote-tracking branch 'origin/pr/2992' 2017-09-21 09:12:03 +02:00
Ryan Farley
dd4294de03 fix #2979: use dictionary for mutable tracking
Using a dictionary instead of a list keeps only one working copy,
allowing consistency in between calls of update_mutables()
2017-09-19 16:26:02 -05:00
Ryan Farley
cc540bb166 Merge branch 'master' into mutable-dict 2017-09-19 14:07:46 -05:00
Ryan Farley
83473b9c69 fix test for new tuples 2017-09-19 14:00:44 -05:00
Felix Van der Jeugt
8db630d358
don't copy values but set dirty 2017-09-19 17:26:03 +02:00
Florian Bruhin
e9b8288e4b Add a test for Config._set_value without backend 2017-09-19 07:08:56 +02:00
Florian Bruhin
13a8867e13 Add tests for config.get_backend() 2017-09-19 07:05:36 +02:00
Florian Bruhin
5298d14084 Move backend initialization to config.py 2017-09-18 23:01:17 +02:00
Florian Bruhin
fe05947b54 Add a new qt_args setting
See #2589
2017-09-17 22:53:27 +02:00