Sublime Forum

Updating sublime text removes all my custom syntax fixes

#1

I have a super annoying problem,
The extensions for syntax checking for C and C++
that are supported do not detect DEFINES nor ENUMS in cod look ups
aka Go To definition doesn’t work for them.
Applying the solution provided by christoph314 here:

is always lost when my linux system dose an update…
What better solution can you provide to make sure this doesn’t repeat and i don’t have to always manually fix this bugs in the syntax checker ???

0 Likes

#2

Do you have the fixed files in the Packages > Default directory? That way they override whatever is installed by the ST application and will not be overwritten.

0 Likes

#3

**Never** update a sublime-package file directly unless you made it from scratch and manually placed it into the Installed packages folder. When package updates happen, they’re done by removing the old sublime-package file and replacing it with a new one. So upgrading Sublime will wipe out package changes, and so will Package Control if it upgrades a package.

I would recommend installing the OverrideAudit package (Disclaimer: I am the author of the package) to make these kinds of changes,

Once it’s installed, choose OverrideAudit: Create Override from the command palette, and when prompted choose the package you want to modify, followed by the file you want to change. That will open the file up for you to edit. Make any changes you want and save the file.

If you now use Preferences > Browse Packages, you will see a folder named for the package you selected, and inside of it the file that you modified. As long as that file is there, Sublime will load it and use it instead of the file in the sublime-package file.

If the underlying package file changes (for example a new version of Sublime has an enhanced syntax), the change will be masked from you and Sublime will always load the overriden file that you created. OverrideAudit will warn you if this is happening, so you can check and see if you’re missing any important changes or fixes.

3 Likes