Sublime Forum

CTRL-C clears clipboard on no selection

#1

I accidentally type CTRL-C when I meant CTRL-V with the cursor in a space where I want to paste. Sublime deletes what was on the clipboard and I end up pasting null into my text, having to go back to the original text and then copy and page again being careful not to hit the wrong key.

Is there some setting that will fix this so that if nothing is selected CTRL-C does not perform a copy?

0 Likes

#2

The following setting it turned on by default and may potentially be the cause of your issue. If you haven’t turned it off in your own user preferences, you might want to try doing so to see if it resolves your problem:

    // If true, the copy and cut commands will operate on the current line
    // when the selection is empty, rather than doing nothing.
    "copy_with_empty_selection": true,

As the comment mentions, when this is turned on the copy and cut commands both pull the current line into the clipboard. If you intended to paste the contents of the clipboard onto an empty line and pressed the copy key instead, this setting would replace the clipboard contents with the current (empty) line, which sounds somewhat like what you’re experiencing.

Note also that you can use Edit > Paste from History (see the menu for the default key binding for your platform) in such a situation to get back the text that was previously in the clipboard, should you find this setting helps more than it hurts in the general case.

3 Likes

#3

I am having a very similar situation. I started noticing that the copy function will work once or twice, but then stops working until I copy the same thing again.

0 Likes