IDEA-133842 "Copy Reference" highlights whole document

(cherry picked from commit 9f0322b8444f2d8106b7fed31f06b0c7daaf6a88)