Improve detection for the type in the Editor of the Script panel
Merge remote-tracking branch 'origin/issue6830' into issue6830