在Intellij 2022.1中,我使用 ctrl+ shift+ r
在文件窗口中添加替换 - 它在40多个文件中显示了100+匹配。搜索字符串和替换字符串在中只有一个字符,例如: this.bar.is.fooed
和 this.barf.is.fooed 。我只需要根据附近的文本替换某些实例。
我在凹槽中,单击替换
按钮,检查下一个条目,单击,检查,...并认为我的大脑可以保持直截了当(不能;您的大脑也无法: - )当我意识到最后几个替换是错误的时,我已经走了一半。
我该如何撤消它们? ctrl+z
是灰色的。 这相关的问题都不会说和喷气桥文档也没有!
In intellij 2022.1, I use Ctrl+Shift+R
to bring up the Replace in Files window - it shows 100+ matches in 40+ files. The search string and the replace string differ in only one character, for example: this.bar.is.fooed
and this.barf.is.fooed
. I only need to replace certain instances based on nearby text.
I'm in the groove, clicking the Replace
button, checking the next entry, clicking, checking, ... and thinking my brain can keep things straight (it can't; neither can yours:-) I'm halfway through when I realize the last few replaces were wrong.
How can I undo them? Ctrl+Z
is grayed out. This related SO question doesn't say and neither does the JetBrains documentation!
发布评论
评论(2)
使用本地历史记录以恢复更改。
替换对话框不支持撤消/重做,对相关请求进行投票。
Use Local History to revert the changes.
Undo/redo is not supported for Replace dialog, vote for the related request.
对于那些不熟悉“显示本地历史”工作流程的人:
提出项目窗格和右键单击 项目的根。
在右键单击上下文菜单中,转到
本地历史记录>显示本地历史...
。在历史记录窗格中,选择要还原的编辑(如果您错误地命中
替换所有
,则会有一个nity nater naterrepleast all all)。
最后,右键单击您选择的编辑,然后从上下文菜单中选择
还原
。For those not familiar with the "Show Local History" workflow:
Bring up the Project Pane and right-click on the root of the project.
In the right-click context menu, go to
Local History > Show Local History...
.In the History Pane, select the edits you want to revert (if you mistakenly hit
Replace all
, then there will be an edit calledReplace all
).Finally, right click on the edits you selected and select
Revert
from the context menu.