mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-132454 "Clear Read-Only Status" dialog displayed twice on cancel
This commit is contained in:
@@ -59,18 +59,19 @@ public class LookupTypedHandler extends TypedActionHandlerBase {
|
||||
@Override
|
||||
public void execute(@NotNull Editor originalEditor, char charTyped, @NotNull DataContext dataContext) {
|
||||
final Project project = CommonDataKeys.PROJECT.getData(dataContext);
|
||||
PsiFile file;
|
||||
PsiFile file = project == null ? null : PsiUtilBase.getPsiFileInEditor(originalEditor, project);
|
||||
|
||||
if (project == null
|
||||
|| (file = PsiUtilBase.getPsiFileInEditor(originalEditor, project)) == null
|
||||
|| !CodeInsightUtilBase.prepareEditorForWrite(originalEditor)
|
||||
|| !FileDocumentManager.getInstance().requestWriting(originalEditor.getDocument(), project)) {
|
||||
if (file == null) {
|
||||
if (myOriginalHandler != null){
|
||||
myOriginalHandler.execute(originalEditor, charTyped, dataContext);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!CodeInsightUtilBase.prepareEditorForWrite(originalEditor) || !FileDocumentManager.getInstance().requestWriting(originalEditor.getDocument(), project)) {
|
||||
return;
|
||||
}
|
||||
|
||||
CompletionPhase oldPhase = CompletionServiceImpl.getCompletionPhase();
|
||||
if (oldPhase instanceof CompletionPhase.CommittingDocuments && ((CompletionPhase.CommittingDocuments)oldPhase).isRestartingCompletion()) {
|
||||
assert oldPhase.indicator != null;
|
||||
|
||||
Reference in New Issue
Block a user