PDT: Strip spaces from Command Line input

Also ignores blank commands rather than showing an error message.
This commit is contained in:
Alan Odom 2020-01-10 20:19:58 +00:00 committed by Rune Morling
parent 9055e26842
commit 71c8fa1712
1 changed files with 5 additions and 3 deletions

View File

@ -175,14 +175,16 @@ def command_run(self, context):
scene = context.scene
pg = scene.pdt_pg
cmd = pg.command
cmd = pg.command.strip()
if cmd.strip() == "?" or cmd.lower().strip() == "help":
if cmd == "?" or cmd.lower() == "help":
# fmt: off
context.window_manager.popup_menu(pdt_help, title="PDT Command Line Help", icon="INFO")
# fmt: on
return
if len(cmd) < 3:
elif cmd == "":
return
elif len(cmd) < 3:
pg.error = PDT_ERR_CHARS_NUM
context.window_manager.popup_menu(oops, title="Error", icon="ERROR")
return