diff --git a/install.js b/install.js index 3db88154..f7f29ad6 100644 --- a/install.js +++ b/install.js @@ -57,7 +57,6 @@ try { compat: true, name: "ace" }); - process.exit(0); } catch (e) { console.log("--- Ace Build error ---"); console.log(e); diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index fa570e66..e053e33f 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -215,6 +215,22 @@ var TextInput = function(parentNode, host) { } }); } + else if (useragent.isOpera) { + event.addListener(parentNode, "keydown", function(e) { + if ((useragent.isMac && !e.metaKey) || !e.ctrlKey) + return; + + if ((e.keyCode == 88 || e.keyCode == 67)) { + var copyText = host.getCopyText(); + if (copyText) { + text.value = copyText; + text.select(); + if (e.keyCode == 88) + host.onCut(); + } + } + }); + } else { event.addListener(text, "copy", onCopy); event.addListener(text, "cut", onCut); @@ -264,8 +280,7 @@ var TextInput = function(parentNode, host) { text.style.cssText = 'position:fixed; z-index:1000;' + - 'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'; - + 'left:' + (mousePos.x - 2) + 'px; top:' + (mousePos.y - 2) + 'px;'; } if (isEmpty) text.value='';