IDEA-200666 don't show empty editors

This commit is contained in:
Dmitry.Krasilschikov
2019-01-23 18:50:25 +02:00
parent 97a3573f33
commit a034658bd6
@@ -372,6 +372,10 @@ public class RecentLocationsAction extends AnAction {
Document fileDocument = positionOffset.getDocument();
int lineNumber = fileDocument.getLineNumber(positionOffset.getStartOffset());
TextRange actualTextRange = getTrimmedRange(fileDocument, lineNumber);
if (actualTextRange.isEmpty()) {
return null;
}
EditorFactory editorFactory = EditorFactory.getInstance();
Document editorDocument = editorFactory.createDocument(fileDocument.getText(actualTextRange));
EditorEx editor = (EditorEx)editorFactory.createEditor(editorDocument, project);