From 1301eb0fa41f75cee35dbf456ad357538cc4183d Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Mon, 20 May 2013 09:43:19 +0800 Subject: [PATCH] Use atom-shell's API for pasteboard operations. --- src/app/pasteboard.coffee | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/pasteboard.coffee b/src/app/pasteboard.coffee index e940977f1..92d808395 100644 --- a/src/app/pasteboard.coffee +++ b/src/app/pasteboard.coffee @@ -1,3 +1,4 @@ +clipboard = require 'clipboard' crypto = require 'crypto' # Internal: Represents the clipboard used for copying and pasting in Atom. @@ -20,13 +21,13 @@ class Pasteboard write: (text, metadata) -> @signatureForMetadata = @md5(text) @metadata = metadata - $native.writeToPasteboard(text) + clipboard.writeText(text) # Loads from the clipboard. # # Returns an {Array}. The first index is the saved text, and the second is any metadata associated with the text. read: -> - text = $native.readFromPasteboard() + text = clipboard.readText() value = [text] value.push(@metadata) if @signatureForMetadata == @md5(text) value