Sublime Text 3: 4个空格的制表符不只适用于javascript文件
Sublime Text 3: 4 spaces for tab not working only for javascript files
在Sublime Text 3我有4个tab空格在用户偏好。这是设置文件的一部分:
{
...
// The number of spaces a tab is considered equal to
"tab_size": 4,
// Set to true to insert spaces when tab is pressed
"translate_tabs_to_spaces": false,
// If translate_tabs_to_spaces is true, use_tab_stops will make tab and
// backspace insert/delete up to the next tabstop
"use_tab_stops": true,
// Set to false to disable detection of tabs vs. spaces on load
"detect_indentation": 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,
...
}
它工作良好,除了Javascript文件,其中制表符空格为2。我不明白为什么。
帮忙吗?
我尝试创建Javascript特定的设置文件,但它也不工作。
我也面临同样的问题。如果你打开一个现有的文件,其中选项卡设置为2个空格(从GitHub加载的文件大多有这个),就会出现问题。另一方面,如果你创建了一个新的.js文件,选项卡会被设置为4。
正如@OdatNurd所提到的,你有"detect_indentation"设置为True。
相关文章:
- JavaScript警报适用于int,但不适用于string
- Javascript仅适用于alert()和Debug模式
- Javascript仅适用于jQuery mobile中的页面刷新
- Javascript上传按钮问题,适用于Wordpress
- 支持 JavaScript 的检查例程适用于 Chrome/Opera/IE,但不适用于 Firefox/Safari
- 如何调试遗留的javascript代码(适用于IE,但在Google Chrome中不正常)
- JavaScript调整iFrame大小-适用于Firefox/IE,但不适用于Chrome
- javascript单选按钮验证,适用于chrome,不适用于IE
- 伪元素适用于javascript
- Javascript片段不适用于Chrome,但适用于Internet Explorer
- CSS/JQuery/Javascript加载图标仅适用于firefox
- 使Javascript/JQuery视差幻灯片效果适用于类
- (PHP&JavaScript)a href添加按钮赢得'我不适用于Mozilla,但适用于IE和谷歌
- 如何使用Javascript将文件轻松上传到服务器(适用于Dummies)
- WinRT 语言投影如何详细适用于 JavaScript
- 适用于 Javascript 函数的应用程序范围的身份验证处理程序
- 是否有适用于 JavaScript 的 BCE / CE 日期库
- 是否有适用于JavaScript的WinRT API的机器可读版本
- 使用适用于 JavaScript 的 ArcGIS API 在地图上显示 KMZ 图层的各个图层
- Sublime Text 3: 4个空格的制表符不只适用于javascript文件