justinfx / MayaSublime

Send selected Python and MEL code snippets from SublimeText to Maya via commandPort
MIT License
149 stars 38 forks source link

Fix settings not properly loaded at ST first launch #17

Closed williamledoux closed 10 years ago

williamledoux commented 10 years ago

When the plugin is loaded at startup, sublime.load_settings will not return the expected settings object, causing the plugin to try to communicate with None:None. Editing the plugin or the preference file would make it work until you restart sublime text.

Since I did not find another place to put the init code that would be called at a good time, I simply load settings at each run. It is the way a lot of other plugins have chosen.

justinfx commented 10 years ago

Is this only an issue on windows, and/ST3? This hasn't been an issue before.

williamledoux commented 10 years ago

I remember having the same issue when I tested my pull request on ST2 yesterday. I can double check if you want

On Tue, Nov 5, 2013 at 8:05 PM, Justin Israel notifications@github.comwrote:

Is this only an issue on windows, and/ST3? This hasn't been an issue before.

— Reply to this email directly or view it on GitHubhttps://github.com/justinfx/MayaSublime/pull/17#issuecomment-27802065 .

justinfx commented 10 years ago

I tried to reproduce this on ST2 for OSX, and I don't see the issue. On a fresh load, the plugin connects instantly to the ports specified in the configs. I also changed the port settings, close and reopened ST2 and it tried to connect to the new ports (failing of course since I didn't open them in Maya)

Maybe this is a platform specific bug?

williamledoux commented 10 years ago

I was wrong, it does not happen with ST2 on windows, only ST3. Please see the updated fix. I don't think it will be different on another platform, but can you test with ST3 on mac so that I can maybe filter more ?

williamledoux commented 10 years ago

I think that it is okay now to open it to ST3 users by making a PR with the updated repository file https://github.com/wbond/package_control_channel/blob/master/repository/m.json

justinfx commented 10 years ago

Yep. This has just been done. Thanks!