LineWrapPositionStrategy (@NotNull Editor editor) { LineWrapPositionStrategy result = getDefaultImplementation(); Project project = editor.getProject(); if (project != null && !project.isDisposed()) { PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument()); if (psiFile != null) { result = INSTANCE.forLanguage(psiFile.getLanguage()); } } return result; }