由于某些原因,当我 CTRL + SHIFT + F
格式化时,Eclipse 开始弄乱我的代码。任何超过 80 个字符的行都会被换行,最后带有注释的行真的会搞砸。
在 CTRL + SHIFT + F
之前:
projectile.setPosition((CAMERA_WIDTH / 2) - (projectile.getWidth() / 2), 800);//projectile center is set to middle of screen at bottom
CTRL + SHIFT + F
之后:
projectile.setPosition(
(CAMERA_WIDTH / 2) - (projectile.getWidth() / 2), 800);// projectile
// center
// is
// set
// to
// middle
// of
// screen
// at
// bottom
在 Window > Preferences > General > Editors > Text Editors
中,我的 Print margin column
设置为 150,这是我唯一更改的首选项。即使当我恢复默认值时,Eclipse 仍然会弄乱我的代码。
如何更改此功能?
最佳答案
只需根据您的个人喜好和喜好调整格式化程序设置即可。有很多选项,换行和线宽是其中的一部分
关于eclipse - 如何阻止 Eclipse 的格式弄乱我的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6240389/