Wish Empty selection wipes clipboard using CTRL+C/CTRL+V

Ikkuh

New Member
I like the BX editor a lot but I noticed a small but important difference using the most common shortcuts CTRL+C/CTRL+X and CTRL+V to other developer editors.
If you copy/cut a part of your sourcecode using CTRL+C/CTRL+X and accidentally hit again CTRL+C instead of CTRL+V then your clipboard is wiped. This happens me several times a day.
Could you please change this the way for instance Notepad++ and Textpad handle this?
 

Sandman

Expert
Licensed User
Longtime User
What you describe sounds perfectly correct to me. What probably happens is that the second CTRL+C/CTRL+X copies/cuts a blank line. This behaviour is exactly like it is in Sublime Text, for instance.

The reasoning is that if there is no selection made, the command acts on the whole line. And if that line is empty, well, then you just copied something empty.
 

agraham

Expert
Licensed User
Longtime User
What probably happens is that the second CTRL+C/CTRL+X copies/cuts a blank line
That's the whole point of the request. Notepad++ will not make a copy when there is no text selected and so will maintain the contents of the clipboard. I would also find this useful as I also occasionally hit Ctl+C when I mean to hit Ctl+V and so lose the block of text I have just cut.
 

Ikkuh

New Member
What you describe sounds perfectly correct to me. What probably happens is that the second CTRL+C/CTRL+X copies/cuts a blank line. This behaviour is exactly like it is in Sublime Text, for instance.

The reasoning is that if there is no selection made, the command acts on the whole line. And if that line is empty, well, then you just copied something empty.


To be honest I never experienced this behavior with any editor. Even bigger word processors like Libre office's Writer does it like I subscribed.
The function of CTRL+C is copying anything selected. With no selection the clipboard shouldn't copy anything. So the clipboard shouldn't be wiped.
 

Sandman

Expert
Licensed User
Longtime User
To be honest I never experienced this behavior with any editor.
Which just goes to show that you've never used Sublime Text, for instance.

This behaviour is defined by a setting in Sublime Text, and this is the default value:
B4X:
// If true, the copy and cut commands will operate on the current line
// when the selection is empty, rather than doing nothing.
"copy_with_empty_selection": true,

I wouldn't mind having this as a setting in the .ini for B4X, but I would appreciate the default staying as it is.

Just adding my opinion, and support for the current way of doing things.
 

Ikkuh

New Member
Which just goes to show that you've never used Sublime Text, for instance.

Yes, you are correct. But many other dev. editors / IDE's I did use and behaving differently

Just adding my opinion, and support for the current way of doing things.

I understand and of course I respect people having other opinions, but still think it isn't logical. For me personal I think is isn't correct if CTRL+C wipes the clipboard if there is nothing to copy.
 

AnandGupta

Expert
Licensed User
Longtime User
Well, many text editors behave differently for ctr+c, some even have options for that !

But none can fix my bad habit of pressing ctrl+c on a selected text instead of ctrl+v, which I intended !!
So I use use clipboard manager. Peace of mind.

Regards,

Anand
 
Top