Page 1 of 1

Ctrl-C with empty selection buffer

Posted: Mon Sep 09, 2013 7:58 pm
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.

Re: Ctrl-C with empty selection buffer

Posted: Mon Sep 09, 2013 8:31 pm
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

Re: Ctrl-C with empty selection buffer

Posted: Mon Sep 09, 2013 11:32 pm
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.

Re: Ctrl-C with empty selection buffer

Posted: Tue Sep 10, 2013 12:05 am
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!

Re: Ctrl-C with empty selection buffer

Posted: Tue Sep 10, 2013 4:51 pm
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

Re: Ctrl-C with empty selection buffer

Posted: Wed Sep 11, 2013 5:12 pm
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

Re: Ctrl-C with empty selection buffer

Posted: Sun Sep 15, 2013 7:22 pm
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.

Re: Ctrl-C with empty selection buffer

Posted: Thu Oct 17, 2013 3:00 pm
by eranif
This is now implemented in git head:
copy-cut.png
Eran

Re: Ctrl-C with empty selection buffer

Posted: Thu Oct 17, 2013 3:58 pm
by solewalker
This is really cool :) thanks Eran.