don't select the whole file text in copy reference aciton (IDEA-100443)

This commit is contained in:
peter
2013-02-07 19:35:45 +01:00
parent 6ca8d1e132
commit 01a737ef9a
@@ -104,7 +104,7 @@ public class CopyReferenceAction extends DumbAwareAction {
PsiReference reference = TargetElementUtilBase.findReference(editor, editor.getCaretModel().getOffset());
if (reference != null) {
highlightManager.addOccurrenceHighlights(editor, new PsiReference[]{reference}, attributes, true, null);
} else {
} else if (element != PsiDocumentManager.getInstance(project).getCachedPsiFile(editor.getDocument())) {
highlightManager.addOccurrenceHighlights(editor, new PsiElement[]{element}, attributes, true, null);
}
}