Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I stop Eclipse's format from messing up my code?

Tags:

eclipse

For some reason Eclipse has started messing up my code when I CTRL + SHIFT + F to format. Any line longer than 80 characters is getting wrapped, and lines with comments at the end really get messed up.

Before CTRL + SHIFT + F:

projectile.setPosition((CAMERA_WIDTH / 2) - (projectile.getWidth() / 2), 800);//projectile center is set to middle of screen at bottom

After CTRL + SHIFT + F:

    projectile.setPosition(
            (CAMERA_WIDTH / 2) - (projectile.getWidth() / 2), 800);// projectile
                                                                    // center
                                                                    // is
                                                                    // set
                                                                    // to
                                                                    // middle
                                                                    // of
                                                                    // screen
                                                                    // at
                                                                    // bottom

In Window > Preferences > General > Editors > Text Editors my Print margin column is set to 150 and that is the only preference I have changed. Even when I restore defaults Eclipse still messes up my code.

How do I change this feature?

like image 629
ubiquibacon Avatar asked Feb 16 '26 21:02

ubiquibacon


1 Answers

Just adjust the formatter settings to your personal preferences and gusto and you are set. There are LOTS of options and line wrap and line width are some of them

like image 97
Hyperboreus Avatar answered Feb 18 '26 16:02

Hyperboreus



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!