Sublime Forum

Syntax highlighting "Open all with current extension as" not working

#1

Hi everyone,

I downloaded a custom syntax definition for Lua, and I’m trying to make it the default for all Lua files, but it won’t stick.

When I use the “Open all with current extension as…” option it sets the current file’s syntax highlighting to the definition I’ve selected, but when I open a new Lua file, it reverts back to the default Lua syntax definition.

Even when I close a file that has been set to the custom syntax definition and reopen it, it goes back to default Lua syntax highlighting.

I’ve checked in the User folder and found the Lua.sublime-settings file. It says:

{
“extensions”:
[
“lua”
]
}

I’ve tried deleting the “lua” line, and even deleting the whole file, but it is recreated whenever I open sublime.

I’ve also tried making a .sublime-settings file for the custom syntax definition, but it is ignored by sublime.

I think it may have something to do with the default theme I’m using, but I’m not sure how to change the theme’s settings.

Thanks for your time!

0 Likes

#2

What package is providing the new Lua syntax that you’re using?

0 Likes

#3

Thanks for the reply!

I’m using Gmod Lua, because it has highlighting for the X = function() syntax.

0 Likes

#4

Did you disable the internal Lua package?

The package you mention uses a syntax with the same name as the default one, so at a guess although the setting is being saved, it still associates with the internal package instead (because shipped packages are loaded before all others).

I would try that and see if that clears up the problem.

1 Like

#5

Ah, thank you for the advice, Odat!

I didn’t know about disabling packages. I went into the control palette, searched for disable package, and disabled the default Lua package. Now Gmod Lua is sticking!

Thanks again for your help!

0 Likes