right/left lookup handlers to expand/collapse completion prefixes should work in completion only (peter)

This commit is contained in:
anna
2011-12-27 15:44:06 +01:00
parent b47335a208
commit d5aad94827
@@ -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;
}