“Unexpected trailing character” in sublime when trying to edit preferences

泪湿孤枕 提交于 2019-12-09 12:16:18

问题


I'm trying to change my sublime theme/colour scheme and i get 'unexpected trailing characters'

When I try to save the /User/Preferences.sublime-settings with this config

{
    "theme": "Afterglow-green.sublime-theme",
    "color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme"
}

{
    "tabs_small": true
}

I can't work out why I would be getting that message?


回答1:


Your settings files in Sublime (all of them) need to be valid JSON. Yours should be as follows:

{
    "theme": "Afterglow-green.sublime-theme",
    "color_scheme": "Packages/Theme - Afterglow/Afterglow.tmTheme",
    "tabs_small": true
}

Note that everything is enclosed in one (and only one) outer dictionary, denoted by curly braces {}. There should also be a comma , at the end of every key: value pair, except for the last line. If there is only one line, don't use a comma.

Just out of interest, what is the "tabs_small" setting for? It's not one of Sublime's default settings.




回答2:


The selected answer is correct, however this prompt can also occur during application startup.

If this error occurs when you're starting Sublime, navigate to C:/Users/{Your User}/AppData/Roaming/Sublime Text 3/Packages/User and open Plain text.sublime-settings.

The issue with JSON can be resolved here.



来源:https://stackoverflow.com/questions/34443710/unexpected-trailing-character-in-sublime-when-trying-to-edit-preferences

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!