Ctrl-C with empty selection buffer

Discussion about CodeLite development process and patches
lukester
CodeLite Curious
Posts: 3
Joined: Mon Sep 09, 2013 7:50 pm
Genuine User: Yes
IDE Question: C++
Contact:

Ctrl-C with empty selection buffer

Post by lukester »

Hi

I was asked by another user (solewalker) to post feature request 630 here to see if there's any interest so am doing so, along with the patch I use.
Would it be possible to make the behaviour of copying the entire caret line to the clipboard if ctrl-c is hit with an empty selection buffer optional? I have a tendency to "miss" ctrl-v (and hit ctrl-c instead) when I have something in the clipboard and this wipes out what I really want in the clipboard. Hope that makes sense.
It's not pretty as I've just #if-ed out the behaviour and I imagine to be releaseable it would the to be configurable!

Thanks

Luke.
You do not have the required permissions to view the files attached to this post.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by eranif »

Hi,

This patch disables another feature: Copy whole line when there is no selection
I think that this should be optional, probably under the Settings -> Global Editor Preferences -> Caret & Scrolling (I will probably rename this section to something like "Editing & Scrolling")

Eran
Make sure you have read the HOW TO POST thread
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by solewalker »

Oh, I did not know the patch would disable line copying, copying the caret line is what I frequently use. Empty selection is not a big deal as I use a clipboard manager which allows me to manage multiple selection and copy.
lukester
CodeLite Curious
Posts: 3
Joined: Mon Sep 09, 2013 7:50 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by lukester »

Ah OK, solewalker you were thinking my hack didn't copy to the clipboard if the selection was empty AND the caret line was empty? Yeah didn't do that. My preferred behaviour is to only copy something to the clipboard if I have something selected :)

Not that I'm a copy-and-paste type coder, honest!
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by solewalker »

Operation on current caret line is much faster, as there is no shortcut to select current line no matter where my caret is, codelite's behavior is as same as sublime text and monodevelop. Not a problem if I don't messed up Ctrl-V with Ctrl-C :p
lukester
CodeLite Curious
Posts: 3
Joined: Mon Sep 09, 2013 7:50 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by lukester »

And VS!

So I guess if Eran was interested in doing this, there would potentially need to be 3 settings to keep everyone happy:

* ctrl-c with empty selection copies caret line to clipboard regardless of if it is empty (potentially making the clipboard empty)
* ctrl-c with empty selection copies caret line to clipboard regardless only if it is non-empty
* ctrl-c with empty selection never copies anything to clipboard

Like I say, I'm happy enough hacking it to do what I prefer in my own build if this is a right pain to do. Can't do that with VS...

Thanks
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by solewalker »

* ctrl-c with empty selection copies caret line to clipboard regardless only if it is non-empty
+1 for it but don't know how much effort is needed to do this.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by eranif »

This is now implemented in git head:
copy-cut.png
Eran
You do not have the required permissions to view the files attached to this post.
Make sure you have read the HOW TO POST thread
solewalker
CodeLite Veteran
Posts: 75
Joined: Thu Mar 14, 2013 11:24 am
Genuine User: Yes
IDE Question: C++
Contact:

Re: Ctrl-C with empty selection buffer

Post by solewalker »

This is really cool :) thanks Eran.
Post Reply