Why won't IntelliJ use tabs?

馋奶兔 提交于 2019-12-22 04:54:29

问题


As per How can I use tabs for indentation in IntelliJ IDEA?, I have gone through and set each extension to "Use tab character" as seen below.

It doesn't work though - IntelliJ is still inserting spaces when I hit the tab button. Did I miss something? Where is intelliJ's [Please use tabs like I ef'ing told you to do] button?

(FYI, I'm using IntelliJ Ultimate 2016.2)

This looks promising...

... but apparently it's all lies :(


回答1:


Maybe you have the option Settings->Editor->General->"Allow placement of caret inside tabs" checked.

Deselect it and try again.




回答2:


Go to SettingsEditorCode Style and deselect ‘Detect and use existing file indents for editing’.




回答3:


If you open up the .editorconfig file, you will see something akin to the following

# editorconfig.org  
root = true  

[*]  
indent_style = spaces  
indent_size = 2  
end_of_line = lf  
charset = utf-8  
trim_trailing_whitespace = true  
insert_final_newline = true

I changed it to tab and 4, closed the project and reopened it.
I know this is an absurd step to have to take, and have an open bug report with them about it.



来源:https://stackoverflow.com/questions/41810007/why-wont-intellij-use-tabs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!