Search code examples
intellij-ideaautomated-refactoringintellij-14

IntelliJ Have Safe Delete on by default


In older versions of IntelliJ I remember that Safe Delete was always activated by default, or at least it remembered the last state that I left it in. Now in Intellij 14.0.2, whenever I go to delete, when I'm prompted whether I want to execute Safe Delete, the Safe Delete, Search in comments and strings, and Search for text occurrences check boxes are always unchecked and I have to go check them again ever time that I delete. Is there some way that I can change this?enter image description here


Solution

  • Sounds like some regression. You should report it as a bug on youtrack.jetbrains.com. In the meanwhile, here is a possible workaround:

    There is a Safe delete action in Settings/Keymap which is mapped to ALT+DELETE ( + DELETE on Mac) by default. You can use this shortcut (or remap it to something else) for invoking safe delete directly.

    When you invoke the Safe delete dialog using this action there are two checkboxes (Search in comments and strings, Search for text occurences). Those are not checked by default, but when you invoke the Safe delete action again, IntelliJ remembers the previous options (which is another reason to think that the behavior for the normal delete dialog is a bug).

    enter image description here

    Give it a try