From 43e527957088008b85398bf07ca235d3f8dd749c Mon Sep 17 00:00:00 2001 From: Gordon Hall Date: Tue, 10 Jun 2014 10:39:13 -0400 Subject: [PATCH] fix copy/paste bug on osx/linux/win --- js/shell.js | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/js/shell.js b/js/shell.js index 4fe83d25c..1651925a7 100644 --- a/js/shell.js +++ b/js/shell.js @@ -38,20 +38,10 @@ var ipc = require('ipc'); var clipb = require('clipboard'); - // atom shell forces to implement the clipboard on our own - thanks obama. + // atom shell forces to implement the clipboard (on osx) on our own - thanks obama. Mousetrap.stopCallback = function() { return false }; - Mousetrap.bind('ctrl+c', function(e) { - clipb.writeText(window.getSelection().toString()); - }); - - Mousetrap.bind('ctrl+v', function(e) { - if (document.activeElement) { - document.activeElement.value = clipb.readText(); - } - }); - Mousetrap.bind('command+c', function(e) { clipb.writeText(window.getSelection().toString()); }); @@ -59,6 +49,7 @@ Mousetrap.bind('command+v', function(e) { if (document.activeElement) { document.activeElement.value = clipb.readText(); + document.activeElement.dispatchEvent(new Event('change')); } });