Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Copy/paste issues

 
Charles Angemeyer
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In learning java I'll sometimes (not often) copy code from a web page and paste it into Eclipse so I can test it out.
For example I wanted to copy the code I found here:
http://www.javaworld.com/community/node/8339

In order to test out inner classes and improve my understanding of that feature.
When I copy the code and go to paste it, instead of breaking it apart, line by line, it gives me one very long line.
Is there a way to keep this from happening?
Many thanks.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It works for me copying from Safari into TextEdit on a Mac. What are you copying from/into?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is probably a side effect of either your browser on the way you are copying (example selecting bits of HTML that confuses the IDE). You can try CTRL+SHIFT+F in Eclipse to let it format the code for you. Should prevent the need to worry about the copy/paste problem.
 
Charles Angemeyer
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ctrl-Shift-F worked great. Thank you very much.
(I'm using a Windows machine).
 
Campbell Ritchie
Sheriff
Pie
Posts: 50211
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should work the same on a *nix machine or a Mac.
I think this discussion would fit better in our IDEs forum: moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic