coffeescript意外缩进

coffeescript意外缩进,coffeescript,sublimetext2,Coffeescript,Sublimetext2,有时,当我在Sublime text2中编辑coffeescript文件时,我在将其编译为js时出错: error: unexpected INDENT $.post url, 在sublime text2编辑器中,我看到了有效的缩进: 但如果我在普通编辑器中复制粘贴此代码,我会看到错误的缩进: click: -> debugger;

有时,当我在Sublime text2中编辑coffeescript文件时,我在将其编译为js时出错:

error: unexpected INDENT
                        $.post url,
在sublime text2编辑器中,我看到了有效的缩进:

但如果我在普通编辑器中复制粘贴此代码,我会看到错误的缩进:

click: ->
                            debugger;
                        # delete org here
                        $.post url,
调试器字符串具有错误的额外缩进

那么,如何在sublime text 2中轻松编辑咖啡脚本文件呢? 我在sublime中安装了一个软件包

我的
首选项。升华设置
文件如下:

{
    "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
}

看起来您正在混合制表符和空格。选择
View->Indentation
并确保选中了
Indent Using Spaces
,然后单击
Convert Indentation to Spaces
,您应该已经全部设置好了