unDemian / clipboard-history

Clipboard history package for Atom.io
MIT License
16 stars 2 forks source link

Enable cut-line support #7

Closed dsandstrom closed 10 years ago

dsandstrom commented 10 years ago

I really like both packages so I'm determined to make them work together.

The premise of cut-line is to copy the whole line when no selection is made. Easy enough, but it gets a little trickier. Another cool feature is: when you paste a "whole line" right after you copied it. The paste should go below the current line instead of right where the cursor is.

To tell paste that the clipboard contents is a full line, cut-line adds some clipboard metadata. I added this functionality to your copy method. So I can use your package to copy and theirs to paste.

However, cutting a line is not implemented, I didn't see an easy way to add it. Also, pasting from your package should paste on a new line, that is probably easier to add.

To override their copy, I had to make your keymap more specific than theirs by adding: .workspace.

'.platform-linux .workspace .pane.active > .item-views > .editor':
  'ctrl-c': 'clipboard-history:copy'
dsandstrom commented 10 years ago

I take that back, pasting from your package should not be changed.

dsandstrom commented 10 years ago

This should be good to merge, let me know what you think.

unDemian commented 10 years ago

This looks good, thanks for your work.

dsandstrom commented 10 years ago

What would the best way to enable cut? Can I overload like copy? On Aug 17, 2014 2:38 PM, "Andrei Demian" notifications@github.com wrote:

This looks good, thanks for your work.

— Reply to this email directly or view it on GitHub https://github.com/unDemian/clipboard-history/pull/7#issuecomment-52436058 .

unDemian commented 10 years ago

yeah I think that should do it.