Sublime Forum

Package install resets my user settings file

#1

Hi. New to the forums and Sublime Text. I’m running it on OS X El Capitan.

I like to reorganise my settings file entries into categories, with comment headers. Something as such:

/*---------
    TEXT
----------*/ 
"font_face": "Source Code Pro",
"font_size": 14,
"gutter": true,

/*---------
  THEME
----------*/ 
"material_theme_accent_brba": true,
"material_theme_accent_scrollbars": true,
"material_theme_arrow_folders": true,

the problem is, whenever I install a new package the custom formatting of the user settings file gets reset. All the things I’ve added remain, however they get reordered and the comments deleted. How can I keep custom formatting?

Thanks.

0 Likes

#2

Package Control disables the package as it is being installed so that Sublime Text doesn’t try to read the package source files as they are being written to disk. Once fully written to disk, the package is re-enabled.

The process of adding an ignored package to settings and then removing it causes the settings to be re-written to disk. Unfortunately currently there isn’t a JSON parser and encoder that can round-trip comments and key/value formatting, so the custom formatting is lost.

I think the only way we could accomplish something like this would be to add a third settings file – a machine-generated file. However, then we would run into issues where we don’t know if the hand-edited settings or machine-written settings are supposed to be the override. For users it would lead to confusion since they would see their settings file and the default settings, but they’d also have to look at a third file to see if some code had modified settings also.

1 Like

#3

This has been discussed a lot here:

I personally think putting man hours into this is a waste of developer time.

0 Likes