Merge pull request #643 from gordonwritescode/bug/join-copy-shell
I manually teste the copy& paste and it works. Since this is a minor PR (couple of lines) I am merging it.
This commit is contained in:
commit
72e2960202
1 changed files with 2 additions and 11 deletions
13
js/shell.js
13
js/shell.js
|
|
@ -39,22 +39,12 @@
|
||||||
var ipc = require('ipc');
|
var ipc = require('ipc');
|
||||||
var clipb = require('clipboard');
|
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() {
|
Mousetrap.stopCallback = function() {
|
||||||
return false
|
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) {
|
Mousetrap.bind('command+c', function(e) {
|
||||||
clipb.writeText(window.getSelection().toString());
|
clipb.writeText(window.getSelection().toString());
|
||||||
});
|
});
|
||||||
|
|
@ -62,6 +52,7 @@
|
||||||
Mousetrap.bind('command+v', function(e) {
|
Mousetrap.bind('command+v', function(e) {
|
||||||
if (document.activeElement) {
|
if (document.activeElement) {
|
||||||
document.activeElement.value = clipb.readText();
|
document.activeElement.value = clipb.readText();
|
||||||
|
document.activeElement.dispatchEvent(new Event('change'));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue