Android studio prevents reformatting code on insert

I started using Android Studio (replacing Eclipse), and one thing I just can’t get used to is how Studio automatically (under certain circumstances) reformats some or even all of my code in the current file. One of these circumstances is pasting text into my file. when I do this, the entire block is reformatted according to secret rules that I can format (but seriously dislike) in the settings.

Is there a flag somewhere in the settings that disabled this?

I can easily format my own code, and since I can also manually tell Studio to β€œdo it now”, there seems to be no reason to put up with all the automatic manual hold.

+6
source share
1 answer

You can stop it by setting the Reformat on paste parameter to none. You can find the option in Editor β†’ General β†’ Smart Keys . See Image

enter image description here

You can temporarily disable formatting by pasting the code by pressing Ctrl + Alt + Shift + V

Alternatively, you can right-click where you want to paste the code, and then click Paste Simple

enter image description here

+6
source

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


All Articles