mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
Fixed issue introduced by change in the lexer that caused mitmproxy to
crash when pressing `:`.
This commit is contained in:
parent
875adb2ba8
commit
af7088d7f3
@ -89,21 +89,28 @@ class CommandBuffer:
|
|||||||
"""
|
"""
|
||||||
parts, remhelp = self.parse_quoted(self.text)
|
parts, remhelp = self.parse_quoted(self.text)
|
||||||
ret = []
|
ret = []
|
||||||
for p in parts:
|
if parts == []:
|
||||||
if p.valid:
|
# Means we just received the leader, so we need to give a blank
|
||||||
if p.type == mitmproxy.types.Cmd:
|
# text to the widget to render or it crashes
|
||||||
ret.append(("commander_command", p.value))
|
ret.append(("text", ""))
|
||||||
|
ret.append(("text", " "))
|
||||||
|
else:
|
||||||
|
for p in parts:
|
||||||
|
if p.valid:
|
||||||
|
if p.type == mitmproxy.types.Cmd:
|
||||||
|
ret.append(("commander_command", p.value))
|
||||||
|
else:
|
||||||
|
ret.append(("text", p.value))
|
||||||
|
elif p.value:
|
||||||
|
ret.append(("commander_invalid", p.value))
|
||||||
else:
|
else:
|
||||||
ret.append(("text", p.value))
|
ret.append(("text", ""))
|
||||||
elif p.value:
|
ret.append(("text", " "))
|
||||||
ret.append(("commander_invalid", p.value))
|
if remhelp:
|
||||||
else:
|
ret.append(("text", " "))
|
||||||
ret.append(("text", ""))
|
for v in remhelp:
|
||||||
ret.append(("text", " "))
|
ret.append(("commander_hint", "%s " % v))
|
||||||
if remhelp:
|
|
||||||
ret.append(("text", " "))
|
|
||||||
for v in remhelp:
|
|
||||||
ret.append(("commander_hint", "%s " % v))
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
def flatten(self, txt):
|
def flatten(self, txt):
|
||||||
|
Loading…
Reference in New Issue
Block a user