Go Down

Topic: X11 paste in IDE (Read 6083 times) previous topic - next topic

ardnut

Hi,

one very useful feature on X11 based systems is PRIMARY buffer. As soon as any text is selected it is copied to the buffer, then clicking mouse button 3 (often scroll wheel click) then pastes the buffer.

This is about an order of magnitude faster the all the right-click context menu cut and paste method.

Unfortunately neither the copy not the paste works with arduino IDE

This makes even minor editing of the code in the IDE window is much more labourious than it needs to be.

This feature is inherent to all X11 windows, so what is preventing this from working in the IDE?

Can it be fixed?

dxw00d

#1
Aug 06, 2012, 09:14 am Last Edit: Aug 06, 2012, 09:16 am by dxw00d Reason: 1
I didn't realise that. I usually use the keyboard for copy/paste (I find it faster than having to move a hand to the mouse). As the IDE is written in Java, I suspect it relates to that. A quick google suggests that, at least, some other Java based applications suffer the same problem (including some versions of Eclipse). jEdit on the Sun box I have here doesn't support middle-click paste. Even though it is standardised, I presume it still has to be implemented as a mouse click event.

CrossRoads

I just use CTRL-C to copy and CTRL-V to paste. Seems quick enough.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dxw00d

Or Ctrl-Insert/Shift-Insert. Keyboard controls are usually quicker.

westfw

On Mac, I use x-style select for copy, and cmd-V for paste into arduino.  There may be an additional cmd-C needed as well, connecting X paste buffers with Mac paste buffers presents interesting challenges.  Probably true of windows as well.

ardnut


I just use CTRL-C to copy and CTRL-V to paste. Seems quick enough.


Well it's better than going through the menus but  if I'm selecting text it's almost sure that I'm doing it with the mouse, editing and shifting code around, or copying code from browser or other files. This is where X11 pasting is a huge time saver.

So rather than needing to pick up the mouse to do the paste it's a case of dropping the mouse to do
CTRL-V

I was forgetting the "IDE" was written in java. I'll have to dig a bit to see if it's a universal problem with java or a common java programming defect.

Thanks for the replies.

BTW the mouse copy-on-select does not work either.

dxw00d

Quote
f I'm selecting text it's almost sure that I'm doing it with the mouse


That's the difference. Almost all my editing is pretty much keyboard based.

WizenedEE


Quote
f I'm selecting text it's almost sure that I'm doing it with the mouse


That's the difference. Almost all my editing is pretty much keyboard based.


Trying to copy text from one window to another is hardly "editing." The sequence of buttons could either be
windows:
Code: [Select]

1.Select text on one window
2.Press "ctrl-c"
3.Click on other window
4.Press "ctrl-v"

X11:
Code: [Select]

1.Select text on one window
2.Middle click on other window

CrossRoads

Ctrl-C, Ctrl-V easy enough to remember for me. And more likely to work in more places.
I don't see how just highlighting the text copies it into a paste buffer.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dxw00d

Quote
Trying to copy text from one window to another is hardly "editing."


Indeed, but as a generic term, 'editing' will do.

kg4wsv

Quote
I don't see how just highlighting the text copies it into a paste buffer.

That's the way X11 has worked for, I dunno, 25 years or more?

I'm a keyboard kind of guy, but if you are already moving between windows to copy and paste, that implies a mouse (to select the "copy" text even if you use the keyboard to switch windows), which means you've got your finger on the trigger to paste, X11 style.  Depending on your settings, you can select the target window and paste with a single click.

-j

WizenedEE

This thread seems to have devolved into people who have used X11 saying how nice the middle click paste is and the people who haven't saying it seems useless/impossible.

I'm pretty sure there's nothing the IDE developers can do about this and that it should be reported upstream.

ardnut

Which "upstream" would that be?

Here's a new twist. The error window of the IDE does support X11 c&p but does not respond to a right click to do it windows style off context menus.

This can not be laid at the door of java or anyone else it has to be arduino IDE.

(both windows work with control key sequences, apparently the only copy/paste method that was tested)

Since the official team have not fixed the disastrous heap allocation bugs in the two years since a fix was provided , I don't see much hope of this getting any attention.

I could be wrong, but it does not inspire hope.

pYro_65

Gotta remember, the Due will most probably need a new IDE, hopefully the standard arduinos go with it, hopefully they have considered a lot of what has been reported in its design. But yes its not java's fault.

This may be one form of getting things "upstream"

ardnut

Wizened wrote:
Quote
I'm pretty sure there's nothing the IDE developers can do about this and that it should be reported upstream.


That's why I was asking what "upstream" he was referring to.

Thanks for the link to google code arduino but until there is some evidence that someone up there has a will to fix major defects like heap allocation problems and the numerous memory leaks in the official included libs, I will not be wasting time filing bugs.

I'm becoming rather disappointed with the quality of std libraries. It seems that in order to produce a reliable Arduino project it is necessary to vet every line of included code for this sort of careless mistake and/or trawl these forums for bugs and fixes.

All of which rather defeats the point of importing libraries of code.


Go Up