Tabs 缩进时,升华文本不会将制表符转换为空格。。。为什么以及如何修复它?

Tabs 缩进时,升华文本不会将制表符转换为空格。。。为什么以及如何修复它?,tabs,indentation,sublimetext,sublimetext3,spaces,Tabs,Indentation,Sublimetext,Sublimetext3,Spaces,我一直在使用非常有效的升华文本。我有一个问题仍然困扰着我 当我键入JavaScript代码时,如果在提供的缩进级别上额外按下tab,则不会将选项卡转换为空格 以下屏幕截图可能有助于您了解我的问题: 正如您所见,缩进的初始级别正确地格式化为8个空格。如果我再次按tab键,则会插入一个实际的tab字符,而不是我希望的4个空格 以下是我的用户首选项.sublime-settings配置文件: { "color_scheme": "Packages/User/Cobalt (SL).tmTheme",

我一直在使用非常有效的升华文本。我有一个问题仍然困扰着我

当我键入JavaScript代码时,如果在提供的缩进级别上额外按下tab,则不会将选项卡转换为空格

以下屏幕截图可能有助于您了解我的问题:

正如您所见,缩进的初始级别正确地格式化为8个空格。如果我再次按tab键,则会插入一个实际的tab字符,而不是我希望的4个空格

以下是我的用户首选项.sublime-settings配置文件:

{
"color_scheme": "Packages/User/Cobalt (SL).tmTheme",
"detect_indentation": false,
"expand_tabs_on_save": true,
"font_size": 10,
"ignored_packages":
[
    "Vintage"
],
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_automatic_white_space": true,
"use_tab_stops": true,

// Calculates indentation automatically when pressing enter
"auto_indent": true,

// Makes auto indent a little smarter, e.g., by indenting the next line
// after an if statement in C. Requires auto_indent to be enabled.
"smart_indent": true,

// Adds whitespace up to the first open bracket when indenting. Requires
// auto_indent to be enabled.
"indent_to_bracket": false,

// Trims white space added by auto_indent when moving the caret off the
// line.
"trim_automatic_white_space": true,
}


配置似乎设置正确。你知道为什么会发生这种情况以及如何解决吗?

有时候,智能缩进会把事情搞砸。尝试将以下行添加到“首选项”>“用户设置”


“智能缩进”:false

嗯,作为一个快速检查,您能告诉我查看.settings()的结果吗(“将选项卡转换为空格”)。此外,您的首选项中还有一个额外的逗号。ST负责处理,但我想如果你没看到我会告诉你的。@skuroda,谢谢你的建议。对不起,我这个星期五才回来上班。然后,我将尝试您的建议并发回。
view.settings().get(“translate\u tabs\u to\u spaces”)
返回
False
,这意味着该文件中的设置正在更改。它可能是一个绿脓杆菌,也可能是一个ST环境。在开始使用插件之前,请尝试在用户首选项文件中将
detect\u indentation
设置为
false
。嗯,这有点令人失望(因为我希望这是一个简单的解决方案)。右下角写的是“空格”还是“制表符”?您是否为JavaScript文件创建了自定义设置?你能列出你安装的插件吗?