I really can’t do with an editor that clears my clipboard when I accidently copy an empty line.
This is an easy mistake to make:
- cut something with
- move the cursor to an empty line where I want to paste
- accidently hit
- Boom! I have now lost my clipboard contents
Sublime Text had an option to disable copying empty selections but Atom doesn’t. Fortunately, it’s super easy to hack Atom and someone has figured out how to prevent this. I’m pasting it here so I can easily find it.
This is the original post on the Atom forum and here’s the snippet to paste in your Atom init script.
# prevent core:copy if and only if there's one selection in