How to disable automatic Eclipse PDT format when pasting

I am using Eclipse Indigo 3.7.0 with PDT for PHP development. When I copy / paste the code, Eclipse automatically formats it.

For example, copying this:

if ($distance > 50 && $distance <= 100) {$local_score = 8;} if ($distance > 100 && $distance <= 200) {$local_score = 6;} 

Inserted into this:

 if ($distance > 50 && $distance <= 100) { $local_score = 8; } if ($distance > 100 && $distance <= 200) { $local_score = 6; } 

Any idea on how to disable this? Best wishes.

+6
source share
2 answers

This is really bad ...
Try it. Open the workspace /.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.php.ui.prefs with your text editor.
Add "smartPaste = true".

(note that I do not know the side effect)

+16
source
  • Go to window / preferences
  • Then select the Java / Editor / Typing page
  • Then uncheck the "On Insert" / "Adjust Indent" checkbox.
+7
source

Source: https://habr.com/ru/post/892013/


All Articles