Attempt to make plugin compatible with ST3

I have a freeze every time when I run the plugin, so the attempt isn't successful for me, anyone can help?