Sublime Forum

Copy with nothing selected copies the current line

#1

If you copy to the clipboard (super+c) with nothing selected, the current line is copied to the clipboard.

This may be intended behaviour but it is very annoying. I do this all the time by accident, usually when I mean to paste something I’ve copied earlier. Not only does this mean I end up pasting the wrong thing, but also the previous clipboard contents are lost. I’ve often cut the contents I was about to paste, so I have to undo the paste of the duplicate line, then undo the cutting of the source, and repeat the whole exercise.

The expected behaviour is that performing a clipboard copy action with nothing selected should do nothing at all and not modify the contents of the clipboard.

This issue was present in ST2 and now ST3, is it likely to ever be fixed?

Is there any way around this through configuration?

1 Like

Un-usual paste {CTRL + V} || paste not working as intended
#2

Current behavior is very useful, please don’t change it.

1 Like

#3

There’s a configuration for this. The following is from the default settings. Add it to your user settings with false, if you don’t like the default behavior.

[quote] // 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,[/quote]

1 Like