Sometimes when I edit coffeescript files in Sublime text2 I got errors when compile it to js:
error: unexpected INDENT
$.post url,
In sublime text2 editor I see valid indents:
But if I copy paste this code in plain editor I see wrong indents:
click: ->
debugger;
# delete org here
$.post url,
debugger;
string has wrong extra indent.
So how to edit coffeescript files in sublime text 2 with pleasure? I got installed coffeescript package in sublime.
My Preferences.sublime-settings
file is the following:
{
"auto_indent": true,
"auto_match_enabled": true,
"detect_indentation": true,
"draw_centered": false,
"font_size": 11.0,
"ignored_packages":
[
"Better CoffeeScript",
"Vintage"
],
"indent_guide_options":
[
"draw_active"
],
"indent_subsequent_lines": true,
"indent_to_bracket": true,
"smart_indent": true,
"tab_size": 2,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"use_tab_stops": true,
"word_wrap": "auto",
"wrap_width": 0
}
It looks like you are mixing tabs and spaces. Select View->Indentation
and make sure that Indent Using Spaces
is checked, then click Convert Indentation to Spaces
and you should be all set.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With