4

My sublime text user preference file get rewritten. (user/Preferences.sublime-settings)

I wrote some comments about the settings that I made (So that I can remember next time I look at the user preference file.) But it removed all the comments and reshuffle all the settings. Is it a normal behavior?

Can I keep my comments in the user preference file? I search through stackoverflow and could not find similar question.

NotepadPlusPlus PRO
  • 987
  • 1
  • 8
  • 21

1 Answers1

3

Yes, this is normal behavior (unfortunately), and there is no way around it - it is hard-coded into Sublime. The same behavior exists in Sublime Text 3 as well. The issue has already been reported to the unofficial Sublime Text Issues repository, so the community is aware of it, but whether or not Sublime's author takes notice of it and/or fixes it is up to him alone.

MattDMo
  • 100,794
  • 21
  • 241
  • 231
  • Thanks. I did not know that. I wonder what is the reason behind that. – NotepadPlusPlus PRO Oct 29 '14 at 19:53
  • 1
    @user2920692 No idea. None of the other user preference files behave this way, so he must have had a reason, but he has neglected to share it with the rest of us :) – MattDMo Oct 29 '14 at 20:05
  • I guess, I have to go with the workaround suggested in the bug report. I will keep two preference files, one in the ST config folder and other in some other folder with all the comments. – NotepadPlusPlus PRO Oct 31 '14 at 14:14
  • [Comments were removed](https://plus.google.com/+DouglasCrockfordEsq/posts/RK8qyGVaGSr) by JSON's creator, Douglas Crockford – skube Feb 12 '15 at 15:58
  • @skube yes, there are no comments in "official" JSON files. What's interesting about Sublime's case is that only this file is rewritten to reorganize settings and remove comments - all the other config files, which are also JSON-formatted, allow both single- and multi-line JS comments, and **don't** get rewritten. – MattDMo Feb 12 '15 at 17:40
  • Actually it's not the _only_ file with this behaviour. `Package Control.sublime-settings` is also reorganized/stripped. But yes, most do retain comments. – skube Feb 13 '15 at 13:36