|
@@ -1492,6 +1492,7 @@ ko.bindingHandlers.aceEditor = {
|
|
|
var onCopy = options.onCopy || function () {};
|
|
var onCopy = options.onCopy || function () {};
|
|
|
var onPaste = options.onPaste || function () {};
|
|
var onPaste = options.onPaste || function () {};
|
|
|
var onAfterExec = options.onAfterExec || function () {};
|
|
var onAfterExec = options.onAfterExec || function () {};
|
|
|
|
|
+ var onExecute = options.onExecute || function () {};
|
|
|
var autocompleter = options.autocompleter || null;
|
|
var autocompleter = options.autocompleter || null;
|
|
|
|
|
|
|
|
$el.text(options.value());
|
|
$el.text(options.value());
|
|
@@ -1662,6 +1663,15 @@ ko.bindingHandlers.aceEditor = {
|
|
|
onChange(e, editor, valueAccessor);
|
|
onChange(e, editor, valueAccessor);
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ editor.commands.addCommand({
|
|
|
|
|
+ name: "execute",
|
|
|
|
|
+ bindKey: {win: "Ctrl-Enter", mac: "Command-Enter|Ctrl-Enter"},
|
|
|
|
|
+ exec: function() {
|
|
|
|
|
+ options.value(editor.getValue());
|
|
|
|
|
+ onExecute();
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
editor.commands.on("afterExec", function (e) {
|
|
editor.commands.on("afterExec", function (e) {
|
|
|
editor.session.getMode().$id = valueAccessor().mode(); // forces the id again because of Ace command internals
|
|
editor.session.getMode().$id = valueAccessor().mode(); // forces the id again because of Ace command internals
|
|
|
if ((editor.session.getMode().$id == "ace/mode/hive" || editor.session.getMode().$id == "ace/mode/impala") && e.args == ".") {
|
|
if ((editor.session.getMode().$id == "ace/mode/hive" || editor.session.getMode().$id == "ace/mode/impala") && e.args == ".") {
|