diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 938b62f29..4b0928b31 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -33,7 +33,7 @@ import pygments.lexers import pygments.formatters from qutebrowser.commands import userscripts, cmdexc, cmdutils, runners -from qutebrowser.config import config, configexc +from qutebrowser.config import config, configexc, configdata from qutebrowser.browser import (urlmarks, browsertab, inspector, navigate, webelem, downloads) from qutebrowser.keyinput import modeman @@ -1540,21 +1540,8 @@ class CommandDispatcher: raise cmdexc.CommandError("Invalid command {}!".format( command)) path = 'commands.html#{}'.format(command) - elif '->' in topic: - # FIXME:conf refactor - parts = topic.split('->') - if len(parts) != 2: - raise cmdexc.CommandError("Invalid help topic {}!".format( - topic)) - try: - config.instance.get(*parts) - except configexc.NoSectionError: - raise cmdexc.CommandError("Invalid section {}!".format( - parts[0])) - except configexc.NoOptionError: - raise cmdexc.CommandError("Invalid option {}!".format( - parts[1])) - path = 'settings.html#{}'.format(topic.replace('->', '-')) + elif topic in configdata.DATA: + path = 'settings.html#{}'.format(topic) else: raise cmdexc.CommandError("Invalid help topic {}!".format(topic)) url = QUrl('qute://help/{}'.format(path)) diff --git a/tests/end2end/features/misc.feature b/tests/end2end/features/misc.feature index 2983b1c21..6eaa751b1 100644 --- a/tests/end2end/features/misc.feature +++ b/tests/end2end/features/misc.feature @@ -286,11 +286,7 @@ Feature: Various utility commands. And I run :help editor.command And I wait until qute://help/settings.html#editor.command is loaded Then the following tabs should be open: - - qute://help/settings.html#general-editor (active) - - Scenario: :help with invalid setting - When I run :help foo.bar - Then the error "Invalid option foo.bar!" should be shown + - qute://help/settings.html#editor.command (active) Scenario: :help with -t When I open about:blank