From d5aad94827e5defff3d43be0b1202296ef0bde25 Mon Sep 17 00:00:00 2001 From: anna Date: Tue, 27 Dec 2011 15:40:54 +0100 Subject: [PATCH] right/left lookup handlers to expand/collapse completion prefixes should work in completion only (peter) --- .../codeInsight/lookup/impl/LookupActionHandler.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java index a86f80e81068..855b82864608 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/lookup/impl/LookupActionHandler.java @@ -182,6 +182,11 @@ public abstract class LookupActionHandler extends EditorActionHandler { @Override protected void executeInLookup(LookupImpl lookup, DataContext context) { + if (!lookup.isCompletion()) { + myOriginalHandler.execute(lookup.getEditor(), context); + return; + } + BackspaceHandler.truncatePrefix(context, lookup, myOriginalHandler, lookup.getLookupStart() - 1); } } @@ -195,7 +200,7 @@ public abstract class LookupActionHandler extends EditorActionHandler { final Editor editor = lookup.getEditor(); final int offset = editor.getCaretModel().getOffset(); CharSequence seq = editor.getDocument().getCharsSequence(); - if (seq.length() <= offset) { + if (seq.length() <= offset || !lookup.isCompletion()) { myOriginalHandler.execute(editor, context); return; }