webconfig: Fix binding tab

This broke when --preset was introduced.

We allow a "--preset" or "--user" to appear right after the "bind",
and save the value, but don't use it yet.

Fixes #5534.

[ci skip]
This commit is contained in:
Fabian Homborg
2019-01-16 09:29:17 +01:00
parent 2abd0cde85
commit 2b426c1047

View File

@@ -702,6 +702,20 @@ class FishConfigHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
for line in out.split('\n'):
comps = line.split(' ', 2)
# If we don't have "bind", a sequence and a mapping,
# it's not a valid binding.
if len(comps) < 3:
continue
# Store the "--preset" value for later
if comps[1] == '--preset':
preset = True
# There's possibly a way to do this faster, but it's not important.
comps = line.split(' ', 3)[1:]
elif comps[1] == '--user':
preset = False
comps = line.split(' ', 3)[1:]
# Check again if we removed the level.
if len(comps) < 3:
continue