Home Download Buy Blog Forum Support

Empty cut/paste

Empty cut/paste

Postby vim on Sun Jun 15, 2008 6:26 am

Many times I cut text (using Ctrl-x) with intention to patse it elsewhere, but then I accidentally press Ctrl-x/Ctrl-c again instead of Ctrl-v. When realizing that I press the correct Ctrl-v. What I expect to get is the the previous text I cut from the text, but I get an empty text or a new line. Most text editors realize that cutting an empty text is just a mistake (you can even try it when you reply here, on this text box ;) ). I think sublime should correct this and behave the same.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm

Re: Empty cut/paste

Postby jps on Mon Jun 16, 2008 12:12 pm

Ctrl+X cutting the entire line when there's no selection is a fairly common idiom for Windows apps (Visual Studio does it, for instance). It means the key sequence Ctrl+C, Ctrl+V is an easy way to duplicate the current line.

You can change the behaviour by changing the key binding (in Default.sublime-keymap) from:

Code: Select all
<binding key="ctrl+c" command="copy"/>

to:

Code: Select all
<binding key="ctrl+c" command="copy">
    <context name="allSelectionsEmpty" value="false"/>
</binding>
jps
Site Admin
 
Posts: 3062
Joined: Wed Mar 19, 2008 12:33 pm

Re: Empty cut/paste

Postby vim on Mon Jun 16, 2008 1:47 pm

great! thanks.
vim
 
Posts: 298
Joined: Tue May 27, 2008 6:51 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], Majestic-12 [Bot] and 23 guests