Android Studio无法撤消(Android Studio Can't Undo)
有时候当我尝试撤销Android Studio中的更改时,我得到以下结果:
无法撤消
受此操作影响的文件已被更改。
这很好,但我不关心受影响的文件。 我只关心当前文件。 我将在稍后处理这些文件。 有没有办法强制Android Studio撤消当前文件中的文本更改,而不用担心其他文件中的内容? 这是开发者认为他们比用户更了解的情况之一。 让我害怕使用撤销按钮tbh。
Some times when I try to undo changes in Android Studio I get this:
Can't Undo
Following files affected by this action have already been changed.
That's nice but I don't care about the files affected. I only care about the current file. I will deal with those files later. Is there a way to force Android Studio to undo my textual changes in the current file and worry less about what's in other files? This is one of those situations when devs think they know better than the user. Makes me scared of using that undo button tbh.
原文:https://stackoverflow.com/questions/41090536
更新时间:2019-10-30 12:10
最满意答案
原因是
你首先做了一些行动(A),它影响了一些文件,包括一些叫做F的文件。
然后你做了一些改变,这些改变影响了另一组文件,包括前一组但不是F的一些文件。
现在你去文件F&尝试撤消。 F的动作堆栈顶部的动作(最后一个)是A.但是当你请求它恢复时,它必须恢复所有其他文件,因为你正在恢复动作而不仅仅是文本。 但是由于某些其他文件已经因后续操作而发生了变化,因此您的请求无法绕过它们。 所以你正在收到消息。
无法撤消
受此操作影响的文件已被更改。
所以你只需要将你的修改本地恢复到F(或某个文件夹)。 为此,你有一个称为本地历史的工具。
您可以转到您的文件,然后转到VCS - > 本地历史记录 - > 显示历史记录 。 或右键单击您的文件或文件夹 - > 本地历史记录 - > 显示历史记录 。
您可以看到您的多个修订历史记录并恢复您想要的任何人。 :))
The reason for this is
You have first done some action(A) which has affected some set of files including some file called F.
Then you have done some changes which has affected another set of files which including some files on previous set but not F.
Now you go to file F & try to undo. The action(last) on the top of the action stack for F is A. But when you request it to revert back, it has to revert back with all the other files because you are reverting the action not just text. But since some set of other files has over changed with your later actions, your request cannot bypass them. So you are getting message.
Can't Undo
Following files affected by this action have already been changed.
So you want only to revert your changes locally to F(or some folder). For that purpose you have a tool called Local History.
You can go to your file and then VCS -> Local History -> Show History. Or Right click your file or folder -> Local History -> Show History.
You can see your multiple revision histories and restore anyone you want. :))
2016-12-12
相关问答
我修好了它, 由于错误的“sdk路径位置”,这是我的模拟器的adb问题, 我不得不从注册表编辑器中更改它, 解决方案如下: https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB 1-Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK. 2-
...
您的问题中发布的第二张图片显示了工具栏和导航栏,为了使这些可见,请使用以下菜单项: View > Toolbar View > Navigation Bar The second image posted in your question shows the toolbar and the navigation bar, in order to make these visible use the following menu items: View > Toolbar View > Naviga
...
Android Studio和Visual Studio可以安全地共享相同的Android SDK吗? 答案是肯定的,我已经做了很长时间了,它运行正常。 在Visual Studio中,Xamarin Android SDK的默认位置是: C:\Program Files (x86)\Android\android-sdk
C:\ProgramData\Microsoft\AndroidNDK64
在Android Studio中,SDK默认位置为: C:\Users\username\App
...
在主要活动中,像这样: public class MainActivity extends AppCompatActivity implements CameraBridgeViewBase.CvCameraViewListener2{
static {
if(!OpenCVLoader.initDebug())
Log.d(sLog, "OpenCv load fail!");
else
Log.d(sLo
...
我刚发现行mainCanvas.drawPath(currentPath, currentpathPaint); 在两种case MotionEvent.ACTION_UP:和case MotionEvent.ACTION_MOVE:不应该在那里。 它似乎重绘了位图的路径并在画布上。 不确定我说的是正确的android术语。 I just found out that the line mainCanvas.drawPath(currentPath, currentpathPaint); at b
...
事实证明,精彩的CTRL + Z做到了这一点。 这是你最新的事情,所以如果你在此之后做了什么,我不保证这会有效。 It turns out the wonderful CTRL+Z did the trick. This UNDOs your latest thing you did, so if you did anything after this I won't guarantee this will work.
最新版本的Android Studio无法与Glass配合使用。 修复:使用工作版本1.2.1.1( http://tools.android.com/download/studio/canary/1-2-1-1 )。 为我工作。 The latest release of Android Studio does not work with Glass. Fix: Use the working version 1.2.1.1 (http://tools.android.com/download/
...
在文件资源管理器中转到项目位置,并确保从应用程序的模块中删除build文件夹。 例如: my_project/app/build/ 然后,返回到您的项目并找到values.xml ,立即删除这些行并重建它。 当您单击错误并对其进行编辑时,您可能正在编辑生成的生成文件 Go to you project location in File Explorer and make sure to delete the build folder from your app's module. For exam
...
相应于此线程,您可以尝试更改Registry | undo.documentUndoLimit Registry | undo.documentUndoLimit值,但这可能会导致未来的麻烦,至少在内存溢出( stackowerflow :))时。 编辑它: 按Ctrl + Shift + A键入注册表 找到undo.documentUndoLimit项目并设置你想要的值(默认为100) Accordingly to this thread you can try to change Regist
...
原因是 你首先做了一些行动(A),它影响了一些文件,包括一些叫做F的文件。 然后你做了一些改变,这些改变影响了另一组文件,包括前一组但不是F的一些文件。 现在你去文件F&尝试撤消。 F的动作堆栈顶部的动作(最后一个)是A.但是当你请求它恢复时,它必须恢复所有其他文件,因为你正在恢复动作而不仅仅是文本。 但是由于某些其他文件已经因后续操作而发生了变化,因此您的请求无法绕过它们。 所以你正在收到消息。 无法撤消 受此操作影响的文件已被更改。 所以你只需要将你的修改本地恢复到F(或某个文件夹)。 为此,
...