Intellij undo history size, not much?

强颜欢笑 提交于 2020-02-17 06:15:42

问题


I like to be able to undo basically several hours of work in a file. I am unsure how to configure this.

In IntelliJ settings, the clipboard settings I have tried with are 999 and 9999 and 99999 but it still too short on undos.

How can I increase this?


回答1:


In Intellij settings the clipboard settings I have tried with are 999 and 9999 and 99999 but it still too short on undos.

I've failed to see what "clipboard settings" have to do with the "undo limit" (or with "undo" at all). Care to explain?


Local History is definitely the way to go here as it works across sessions, files, and whole folders -- you can undo very complex operations in one click (e.g. replace/refactor in multiple files).


In any case: if Local History is to complex or you are a hardcore person who prefers to hit Ctrl + Z quite a few times in a row instead of few clicks with Local History, you can increase undo limit (which is 100 steps by default). For that:

  • Open Registry (Help | Find Action... and type registry)
  • Find undo.documentUndoLimit entry and set your limit to a higher number (e.g. 1000).

P.S. IDE restart may be required.




回答2:


The "Maximum number of contents to keep in clipboard" setting has nothing to do with undos.

In fact, there is no configurable "undo history size" setting in IntelliJ. See this support issue:

For rolling back complex code changes gone awry, a far better option is to use the local history.

Local History is available under the menu "VCS" -> "Local History" -> "Show History". The feature is explained as:

IntelliJ IDEA tracks any changes you make to your source files or any other file, as well as the changes that affect a directory’s content and structure. This feature will protect you from any accidental losses or modifications, even if made by other applications outside IntelliJ IDEA. Setting version labels is also available. Any time you can inspect the history of either a particular file or directory and rollback to any of its previous versions.




回答3:


Actually, based on JetBrains Docs, for changing undo limit you should act just like below steps:

  1. click Help on the top menu:

  1. Click on Find Action:

  1. Type Registry and open first result:

  1. On the opened window file undo.documentUndoLimit and undo.globalUndoLimit and change it to number what you want.

HINT: After change you should close your JetBrains IDE and open it again.



来源:https://stackoverflow.com/questions/25014049/intellij-undo-history-size-not-much

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!