如何更改 Eclipse 以在 Javascript 编辑器中使用空格而不是制表符?

2022-01-16 00:00:00 javascript eclipse-plugin eclipse jslint

我使用 Eclipse JavaScript 插件,我将文本编辑器设置为将空格作为制表符插入",这工作正常,直到我选择一段代码并将其制表符或切换制表符,运行 JSLint 和 AARGghh!混合空格和制表符."有什么我想念的吗,这可能吗?

I use the Eclipse JavaScript plugin, I have my text editor settings to "insert spaces as tabs" this works fine until I select a block of code and tab it or shift tab it, run JSLint and AARGghh! "Mixed spaces and tabs." is there something I am missing, is this possible?

推荐答案

我不确定你在哪里设置了编辑器属性插入空格作为制表符".要设置选项卡策略,您需要转到 Window >偏好>Javascript >代码风格 >格式化程序,创建一个新的配置文件,编辑它并将选项卡策略设置为仅限空格".现在在使用 tab 键时会插入空格.

I am not exactly sure where you set the editor property "insert spaces as tabs". To set the tab policy you need to go to Window > Preferences > Javascript > Code Style > Formatter, create a new profile, edit it and set the Tab policy to "spaces only". Now when using the tab key spaces are inserted.

相关文章