Use the iter
live template rather than the foreach
. foreach
is under the Android block, and the default style for that is what adds the newline.
Update:
As of at least 2018.1.1 (not sure when it was added), you can now type the <name of your collection>.for
then tab and it will expand out into a foreach loop.
It’s also brought in the same surrounding/expansion for stuff like <array>.stream
then tab and probably a few others I’m not aware of.