Copy to text to clipboard on delete

This commit is contained in:
Ryan Mitchell 2016-04-23 21:33:04 -04:00
parent 145446b8de
commit f8396fb4e4
2 changed files with 11 additions and 1 deletions

View file

@ -347,7 +347,12 @@ class Ex
delete: ({ range }) ->
range = [[range[0], 0], [range[1] + 1, 0]]
atom.workspace.getActiveTextEditor().buffer.setTextInRange(range, '')
editor = atom.workspace.getActiveTextEditor()
text = editor.getTextInBufferRange(range)
atom.clipboard.write(text)
editor.buffer.setTextInRange(range, '')
set: ({ range, args }) ->
args = args.trim()