Sublime Forum

Unexpected trailing characters?

#1

Just starting to learn how to modify this great tool.

I seem to run into this problem a lot:

[quote]Sublime Text 2

Error trying to parse settings: Unexpected trailing characters in C:\Users\Gregory\AppData\Roaming\Sublime Text 2\Packages\User\Preferences.sublime-settings:4:2
[/quote]

Here is the code I was trying to save:

{ "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "font_size": 12 }, { "caption": "Reg Replace: Fold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "fold"} }, { "caption": "Reg Replace: Unfold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "unfold"} }

How do I correct this?

0 Likes

#2

[quote=“kjemmo”]

{ "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "font_size": 12 }, { "caption": "Reg Replace: Fold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "fold"} }, { "caption": "Reg Replace: Unfold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "unfold"} }[/quote]

I suppose you mix different things in the same file.

It must probably be:
Preferences.sublime-settings:

{ "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme", "font_size": 12 }
Default.sublime-commands:

{ "caption": "Reg Replace: Fold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "fold"} }, { "caption": "Reg Replace: Unfold sentence blocks", "command": "reg_replace", "args": {"replacements": "fold_sentence-blocks"], "action": "unfold"} } ]

0 Likes

#3

Thanks.

That was it. Works now.

0 Likes

#4

I got the same mistake, except i had 8:5 at the and, when i got into the file in the error track line i got this

[code]// Auto close tags
{ “keys”: “>”], “command”: “auto_close_tag”, “args”: { “prefix”: “>”}, “context”:

     { "key": "selector", "operator": "equal", "operand": "text.html meta.tag -string -punctuation.definition.tag.begin.html -meta.scope.between-tag-pair.html, text.xml meta.tag -string -punctuation.definition.tag.begin.xml -meta.scope.between-tag-pair.xml", "match_all": true },
     { "key": "preceding_text", "operator": "not_regex_contains", "operand": "(?:\\<(?:img|br|hr|meta|link|base|input)\\>^<]*)|/$" }
  ]

},
// Line and Tab when hitting enter between tags
{ “keys”: “enter”], “command”: “insert_snippet”, “args”: {“contents”: “\n\t$0\n”}, “context”:

     { "key": "setting.auto_indent", "operator": "equal", "operand": true},
     { "key": "selector", "operator": "equal", "operand": "meta.scope.between-tag-pair"}
  ]

}[/code]

dont know what to change so it can load.
Can u help me pls

0 Likes