From e792c83a413411b49e6276b7e1250b589748ffab Mon Sep 17 00:00:00 2001 From: peter Date: Fri, 28 Dec 2012 17:56:12 +0100 Subject: [PATCH] user activity from the current action shouldn't cancel parameter info autopopup request --- .../intellij/codeInsight/AutoPopupController.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupController.java b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupController.java index 47fc17e98a0d..5c8857eb44d0 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupController.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/AutoPopupController.java @@ -141,8 +141,17 @@ public class AutoPopupController implements Disposable { } } - private void addRequest(Runnable request, final int delay) { - myAlarm.addRequest(request, delay); + private void addRequest(final Runnable request, final int delay) { + Runnable runnable = new Runnable() { + public void run() { + myAlarm.addRequest(request, delay); + } + }; + if (ApplicationManager.getApplication().isUnitTestMode()) { + runnable.run(); + } else { + ApplicationManager.getApplication().invokeLater(runnable); + } } private void cancelAllRequest() {