Fix config values being lost with DELETED_OPTIONS
When an option was deleted, we accidentally stopped reading instead of ignoring that one option and then resuming.
This commit is contained in:
parent
325846f20a
commit
7b9d38e438
@ -44,6 +44,12 @@ Changed
|
|||||||
- New `taskadd` userscript to add a taskwarrior task annotated with the
|
- New `taskadd` userscript to add a taskwarrior task annotated with the
|
||||||
current URL.
|
current URL.
|
||||||
|
|
||||||
|
Fixed
|
||||||
|
-----
|
||||||
|
|
||||||
|
- Fixed some configuration values being lost when a config option gets removed
|
||||||
|
from qutebrowser's code.
|
||||||
|
|
||||||
Removed
|
Removed
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
@ -518,7 +518,7 @@ class ConfigManager(QObject):
|
|||||||
k = k[1:]
|
k = k[1:]
|
||||||
|
|
||||||
if (sectname, k) in self.DELETED_OPTIONS:
|
if (sectname, k) in self.DELETED_OPTIONS:
|
||||||
return
|
continue
|
||||||
if (sectname, k) in self.RENAMED_OPTIONS:
|
if (sectname, k) in self.RENAMED_OPTIONS:
|
||||||
k = self.RENAMED_OPTIONS[sectname, k]
|
k = self.RENAMED_OPTIONS[sectname, k]
|
||||||
if (sectname, k) in self.CHANGED_OPTIONS:
|
if (sectname, k) in self.CHANGED_OPTIONS:
|
||||||
|
@ -198,6 +198,17 @@ class TestConfigParser:
|
|||||||
"""Make sure renamed options don't exist anymore."""
|
"""Make sure renamed options don't exist anymore."""
|
||||||
assert option not in configdata.DATA[section]
|
assert option not in configdata.DATA[section]
|
||||||
|
|
||||||
|
def test_config_reading_with_deleted_options(self, objects):
|
||||||
|
"""Test an invalid option with relaxed=True."""
|
||||||
|
objects.cp.read_dict({
|
||||||
|
'general': collections.OrderedDict(
|
||||||
|
[('wrap-search', 'true'), ('save-session', 'true')])
|
||||||
|
})
|
||||||
|
objects.cfg._from_cp(objects.cp)
|
||||||
|
with pytest.raises(configexc.NoOptionError):
|
||||||
|
objects.cfg.get('general', 'wrap-search')
|
||||||
|
assert objects.cfg.get('general', 'save-session')
|
||||||
|
|
||||||
|
|
||||||
class TestKeyConfigParser:
|
class TestKeyConfigParser:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user