coronalabs / CoronaSDK-SublimeText

Corona Editor is the official Corona SDK plugin for Sublime Text
https://coronalabs.com
MIT License
108 stars 28 forks source link

“syntax” setting is forcibly changed to “Corona Lua”. #44

Open super-toki opened 4 years ago

super-toki commented 4 years ago

I save my work, goes back to "Lua" to "Corona Lua". p.s: Please remember that some users like me use the syntax set to "Lua". (NOT CORONA LUA)

[Plugin Version Info] Corona Editor for Sublime Text Version: 2020.08.02.06.33.56 Installed: 2020-08-25 17:59:08.490094 Corona Editor is the official Corona SDK plugin for Sublime Text [Sublime Text 3211/stable/osx/x64]

[Package Control Settings Info] { "bootstrapped": true, "in_process_packages": [ ], "installed_packages": [ "CoronaSDK-SublimeText", "Package Control" ], "repositories": [ "https://github.com/coronalabs/CoronaSDK-SublimeText", ] }

personalnadir commented 4 years ago

If you edit the User settings for Corona Editor you can disable this behaviour. You want to override the extensions and corona_sdk_default_new_file_to_corona_lua fields.

Unless those options are not working, I think this can be closed.

It might make sense to move the Corona Syntax definitions into their own package, I don't think there's any reason for them to be a part of this project. There is a single code reference to the syntax file related to the corona_sdk_default_new_file_to_corona_lua setting which could then be removed.

Zach111 commented 3 years ago

Got the same problem since the latest update.

"corona_sdk_default_new_file_to_corona_lua": false, And this setting is not working.

personalnadir commented 3 years ago

What's the rest of your user settings look like for the plugin?

Zach111 commented 3 years ago

Just this. { "corona_sdk_default_new_file_to_corona_lua": false, } GIF

personalnadir commented 3 years ago

Can you try editing the settings - default file? There's a bit which reads:

// set as default syntax for all Lua files
 "extensions": [
    "lua", "settings"
]

This may be having a global effect. Deleting it or adding the following to your user settings file may fix this issue:

"extensions": []
Zach111 commented 3 years ago

Still not working, tried it both in Settings-Default and Settings-User.

image image

personalnadir commented 3 years ago

Thanks, that's useful to know. It looks like it's a bug with with the GetSetting function in the _corona_utils.py file. The code is using the function settings.get to both check the value of a setting and test for its existence. In the process I don't think it is distinguishing between None and False.

Reading the comments it seems to make concessions towards users setting options in the main sublime settings file, which I think muddies things.

I will delete lines 54 -> 58 and see whether that fixes the issue or introduces any new issues. It will be a few weeks of testing on my own repository before I push this.