Sublime Forum

Empty cut/paste

#1

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 :wink: ). I think sublime should correct this and behave the same.

0 Likes

#2

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:

<binding key="ctrl+c" command="copy"/>

to:

<binding key="ctrl+c" command="copy">
    <context name="allSelectionsEmpty" value="false"/>
</binding>
0 Likes

#3

great! thanks.

0 Likes