mwieder / glx2ScriptEditor

glx2ScriptEditor is an alternative script editor for the LiveCode IDE
MIT License
6 stars 3 forks source link

Complete on Return - Switch control structure: a 'break" is placed after 'default' #21

Closed matthiasrebbe closed 3 years ago

matthiasrebbe commented 3 years ago

When the switch control structure is completed on return then not only after case the break keyword is placed, but also after default.

this is how it looks after completion.

switch tCheck
CASE ""

break
DEFAULT

break
END SWITCH -- tCheck
mwieder commented 3 years ago

Yes - that's there by design. Note that the "default" option doesn't necessarily have to be the last in the list, so the break command is there to ensure that the code won't fall through to any following options unless the break is explicitly removed.