如何在Intellij Idea中撤消文件中的替换?

发布于 2025-01-24 23:21:01 字数 894 浏览 5 评论 0 原文

在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!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

念三年u 2025-01-31 23:21:01

使用本地历史记录以恢复更改。

替换对话框不支持撤消/重做,对相关请求进行投票

Use Local History to revert the changes.

Undo/redo is not supported for Replace dialog, vote for the related request.

零度℉ 2025-01-31 23:21:01

对于那些不熟悉“显示本地历史”工作流程的人:

  1. 提出项目窗格和右键单击 项目的根

  2. 在右键单击上下文菜单中,转到本地历史记录>显示本地历史...

  3. 历史记录窗格中,选择要还原的编辑(如果您错误地命中替换所有,则会有一个nity nater nater repleast all all )。


  4. 最后,右键单击您选择的编辑,然后从上下文菜单中选择还原

For those not familiar with the "Show Local History" workflow:

  1. Bring up the Project Pane and right-click on the root of the project.

  2. In the right-click context menu, go to Local History > Show Local History....

  3. In the History Pane, select the edits you want to revert (if you mistakenly hit Replace all, then there will be an edit called Replace all).

  4. Finally, right click on the edits you selected and select Revert from the context menu.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文