diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java b/plugins/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java index 9f6053d793e2..d9e0c86e128a 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/SpellCheckerManager.java @@ -23,6 +23,8 @@ import com.intellij.openapi.diagnostic.Logger; import com.intellij.openapi.extensions.Extensions; import com.intellij.openapi.project.Project; import com.intellij.openapi.project.ProjectManager; +import com.intellij.psi.PsiManager; +import com.intellij.psi.impl.PsiModificationTrackerImpl; import com.intellij.spellchecker.dictionary.EditableDictionary; import com.intellij.spellchecker.dictionary.Loader; import com.intellij.spellchecker.engine.SpellCheckerEngine; @@ -175,10 +177,13 @@ public class SpellCheckerManager { return !spellChecker.isCorrect(word); } - public void acceptWordAsCorrect(@NotNull String word) { + public void acceptWordAsCorrect(@NotNull String word, Project project) { final String transformed = spellChecker.getTransformation().transform(word); if (transformed != null) { userDictionary.addToDictionary(transformed); + final PsiModificationTrackerImpl modificationTracker = + (PsiModificationTrackerImpl)PsiManager.getInstance(project).getModificationTracker(); + modificationTracker.incCounter(); } } diff --git a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java index 49a61e4fd8a2..8d95d92f22cc 100644 --- a/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java +++ b/plugins/spellchecker/src/com/intellij/spellchecker/quickfixes/AcceptWordAsCorrect.java @@ -52,7 +52,7 @@ public class AcceptWordAsCorrect implements SpellCheckerQuickFix { public void applyFix(@NotNull Project project, @NotNull ProblemDescriptor descriptor) { SpellCheckerManager spellCheckerManager = SpellCheckerManager.getInstance(project); final String w = ProblemDescriptionNode.extractHighlightedText(descriptor, descriptor.getPsiElement()); - spellCheckerManager.acceptWordAsCorrect(w); + spellCheckerManager.acceptWordAsCorrect(w, project); } public Icon getIcon(int flags) {