This is not a problem, right? Enter foreach后回车,确实是换行的格式,但此时输入焦点处于:左边,并有红色竖线提示,完整输入左边部分后(如int aa) and press Enter. The line break after the colon will be automatically canceled. The input focus jumps to after the colon, and then enter the remaining content. See the picture:
In addition, the smarter foreach auto-completion can be done by typing iterEnter, the content to the left of the colon will be automatically filled in, and the input focus is on the right of the colon:
If you want the first completion method to have no line break format, you can set it here and remove the check mark in front of Reformat according style:
This is not a problem, right? Enter
foreach
后回车,确实是换行的格式,但此时输入焦点处于:
左边,并有红色竖线提示,完整输入左边部分后(如int aa
) and press Enter. The line break after the colon will be automatically canceled. The input focus jumps to after the colon, and then enter the remaining content. See the picture:In addition, the smarter foreach auto-completion can be done by typing
iter
Enter, the content to the left of the colon will be automatically filled in, and the input focus is on the right of the colon:If you want the first completion method to have no line break format, you can set it here and remove the check mark in front of
Reformat according style
:IntelliJ IDEA 2016.1.2
When using foreach, type iter itar directly in the editor and add tab and foreach will appear
OK, I found the method. In the edit live template, just check the ensure to style option