From 3677c36a14105cfd29ac7fda76d91ea743b2d25e Mon Sep 17 00:00:00 2001 From: nightwing Date: Fri, 26 Oct 2012 01:50:45 +0400 Subject: [PATCH] add editor.execCommand function --- lib/ace/editor.js | 10 +++------- lib/ace/keyboard/textinput.js | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 340e8e7f..67a296f8 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -656,13 +656,9 @@ var Editor = function(renderer, session) { this.insert(text); }; - /** - * Editor.onDelete() - * - * called whenever a text "delete" happens. - **/ - this.onDelete = function() { - this.commands.exec("del", this); + + this.execCommand = function(command, args) { + this.commands.exec(command, this, args); }; /** diff --git a/lib/ace/keyboard/textinput.js b/lib/ace/keyboard/textinput.js index 970a5ed0..1e215071 100644 --- a/lib/ace/keyboard/textinput.js +++ b/lib/ace/keyboard/textinput.js @@ -139,7 +139,7 @@ var TextInput = function(parentNode, host) { if (data) host.onTextInput(data); else - host.onDelete(); + host.execCommand("del", {source: "ace"}); }; var onCompositionStart = function(e) {