Android的工作室prevent code格式化糊上 [英] Android studio prevent code reformatting on paste

查看:244
本文介绍了Android的工作室prevent code格式化糊上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Android工作室(取代的Eclipse),并有一件事我不能习惯开始是如何Studio自动(在某些情况下)重新格式化部分甚至全部在当前文件我的code的。其中的一个情况下,被粘贴文本到我的文件。当我这样做,整个块被按到神秘的规则我可以​​在设置格式化(但严重不喜欢)重新格式化。

I've 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 those circumstances is pasting text into my file. when I do that, the entire block gets reformatted according to the arcane rules I can format (but seriously do not like) in the Settings.

有一个复选框某处设置,开启这一关?

Is there a check box somewhere in the settings that turns this off??

我可以格式化我自己的code很轻松了,因为我也可以手动告诉工作室以现在就做,似乎没有任何理由忍受所有的自动手控股。

I can format my own code easily enough, and since I can also manually tell Studio to "do it now", there doesn't seem to be any reason to put up with all the automatic hand-holding.

推荐答案

您可以通过设置阻止它在上粘贴格式化选项为none为即可。你可以找到在编辑器选项 - >常规 - >智能钥匙。看到图片

You can stop it by setting the Reformat on paste option to none to None. You can find the option under Editor -> General -> Smart Keys. See the image

您可以通过pressing粘贴code临时关闭格式化的按Ctrl + Alt + Shift + V

You can temporary disable reformat by pasting the code by pressing Ctrl + Alt + Shift + V

Alternatly您可以右键点击您要粘贴code,然后点击粘贴简单

Alternatly you can right click on where you want to paste the code and then click Paste simple

这篇关于Android的工作室prevent code格式化糊上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆