mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
some cases where lookup was not under the prefix fixed
This commit is contained in:
@@ -38,15 +38,6 @@ public class BackspaceHandler extends EditorActionHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean toRestart = false;
|
||||
final String prefix = lookup.getAdditionalPrefix();
|
||||
if (prefix.length() > 0) {
|
||||
lookup.setAdditionalPrefix(prefix.substring(0, prefix.length() - 1));
|
||||
}
|
||||
else {
|
||||
toRestart = lookup.getLookupStart() < editor.getCaretModel().getOffset();
|
||||
}
|
||||
|
||||
lookup.performGuardedChange(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -54,11 +45,13 @@ public class BackspaceHandler extends EditorActionHandler {
|
||||
}
|
||||
});
|
||||
|
||||
final String prefix = lookup.getAdditionalPrefix();
|
||||
if (prefix.length() > 0) {
|
||||
lookup.setAdditionalPrefix(prefix.substring(0, prefix.length() - 1));
|
||||
return;
|
||||
}
|
||||
|
||||
if (toRestart) {
|
||||
if (lookup.getLookupStart() < editor.getCaretModel().getOffset()) {
|
||||
final CompletionProcess process = CompletionService.getCompletionService().getCurrentCompletion();
|
||||
if (process instanceof CompletionProgressIndicator) {
|
||||
((CompletionProgressIndicator)process).restartCompletion();
|
||||
|
||||
@@ -58,7 +58,6 @@ public class TypedHandler implements TypedActionHandler {
|
||||
}
|
||||
});
|
||||
if (result == CharFilter.Result.ADD_TO_PREFIX) {
|
||||
lookup.setAdditionalPrefix(lookup.getAdditionalPrefix() + charTyped);
|
||||
Document document = editor.getDocument();
|
||||
long modificationStamp = document.getModificationStamp();
|
||||
|
||||
@@ -67,6 +66,7 @@ public class TypedHandler implements TypedActionHandler {
|
||||
EditorModificationUtil.typeInStringAtCaretHonorBlockSelection(editor, String.valueOf(charTyped), true);
|
||||
}
|
||||
});
|
||||
lookup.setAdditionalPrefix(lookup.getAdditionalPrefix() + charTyped);
|
||||
|
||||
AutoHardWrapHandler.getInstance().wrapLineIfNecessary(editor, dataContext, modificationStamp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user