Sublime Forum

Clipboard error

#1

Hopefully anyone can help me out on this one, since I’m not sure it’s a bug.

If I copy a selection of code in my clipboard, then I delete some lines elsewhere in the code, now my clipboard is empty!
This happens in all versions of Sublime Text.

Copy and directly pasting works fine, but doing anything in between seems to empty the clipboard.

Thanks for any help in advance!

0 Likes

#2

Do you have any other apps running? Any packages?

0 Likes

#3

No, this happens on a clean install.

0 Likes

#4

What about other apps, that, say, empty your clipboard?

0 Likes

#5

Just found out that it doesn’t really empty the clipboard, it’s more like a dynamic clipboard.
The reference to the line is copied, not the content of the line literally.
It might not even be a bug, but I find it pretty much annoying.

0 Likes

#6

Do you mean that if you change the line the clipboard contents change? This is definitely not default behaviour. Can you please give some repro steps?

0 Likes

#7

Steps for reproduction:

Example CSS

.datepicker > div { display: none; }

Cut these lines (ctrl+x), then remove the remaining empty line (shift-delete). Now paste your clipboard and find out it is empty.

0 Likes

#8

Cannot repro - works fine for me. Clipboard holds exactly what it should. Have you tried on another computer?

0 Likes

#9

Same problem here.
When I copy a line, delete it (+ a few other lines) and then try to paste it the clipboard is empty.

0 Likes

#10

Seems like Windows only… (help!)

0 Likes

#11

Shift+delete is mapped as cut.

When you press shift+delete on an empty line, this will actually cut that line (which is basically a \n char)

If you want to delete a line you may want to learn about ctrl+shift+k.

0 Likes

#12

Thank you iamntz for this solution!

I now replaced CTRL+SHIFT+K by the SHIFT+DELETE in my user key mapping:

{ "keys": "shift+delete"], "command": "run_macro_file", "args": {"file": "res://Packages/Default/Delete Line.sublime-macro"} }
0 Likes