Home Download Buy Blog Forum Support

ctrl-c issue

ctrl-c issue

Postby gothate on Sat Nov 20, 2010 10:27 am

Can we make it so if we ctrl-c on nothing it won't copy nothing?
I keep accidentally overwriting the buffer with nothing :(
gothate
 
Posts: 8
Joined: Sat Nov 20, 2010 10:22 am

Re: ctrl-c issue

Postby tgkeul on Sat Nov 20, 2010 11:41 am

No, please don't.

Sublime copies the current line if nothing is selected. Me and some of my macros rely on that.
tgkeul
 
Posts: 140
Joined: Tue Dec 02, 2008 9:35 pm

Re: ctrl-c issue

Postby jps on Sat Nov 20, 2010 12:49 pm

You can configure this, as described in viewtopic.php?f=4&t=1225&p=5475
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: ctrl-c issue

Postby gothate on Tue Nov 30, 2010 10:06 am

Thanks so much, that's perfect.
gothate
 
Posts: 8
Joined: Sat Nov 20, 2010 10:22 am

Re: ctrl-c issue

Postby gothate on Wed Feb 23, 2011 6:19 am

Okay, after trying about 15 permutations I give up, can someone enlighten me on how to do this in Sublime 2?

{ "keys": ["ctrl+c"], "command": "copy", "context":
[
{ "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }
]
}
gothate
 
Posts: 8
Joined: Sat Nov 20, 2010 10:22 am

Re: ctrl-c issue

Postby jps on Wed Feb 23, 2011 6:35 am

Your key binding will run the copy command when all selections are empty. What you want is to run _no_ command when all selections are empty, which you can do by adding this to your user key bindings:

Code: Select all
{ "keys": ["ctrl+c"], "command": "", "context":
   [
      { "key": "selection_empty", "operator": "equal", "operand": true, "match_all": true }
   ]
}
jps
Site Admin
 
Posts: 3067
Joined: Wed Mar 19, 2008 12:33 pm

Re: ctrl-c issue

Postby gothate on Wed Feb 23, 2011 6:55 am

Thanks for the quick reply! Trying to pick up the new formatting and the logic with no documentation yet was a bit too much, that makes sense though. Appreciated!
gothate
 
Posts: 8
Joined: Sat Nov 20, 2010 10:22 am

Re: ctrl-c issue

Postby oats on Wed Feb 23, 2011 3:47 pm

that solution seems obscure enough that a "user preference" might be a better solution.
"copyLineWhenNoSelection" : true or false
oats
 
Posts: 101
Joined: Mon Nov 09, 2009 4:39 pm


Return to General Discussion

Who is online

Users browsing this forum: Exabot [Bot] and 22 guests