diff --git a/lib/ace/ext/emmet.js b/lib/ace/ext/emmet.js index 785dbccd..552350e4 100644 --- a/lib/ace/ext/emmet.js +++ b/lib/ace/ext/emmet.js @@ -318,10 +318,15 @@ function runEmmetCommand(editor) { editorProxy.setupContext(editor); if (editorProxy.getSyntax() == "php") return false; - var actions = emmet.require("actions") + var actions = emmet.require("actions"); + if (this.action == "expand_abbreviation_with_tab") { + if (!editor.selection.isEmpty()) + return false; + } + try { - var result = actions.run(this.name, editorProxy); + var result = actions.run(this.action, editorProxy); } catch(e) { editor._signal("changeStatus", typeof e == "string" ? e : e.message); console.log(e); @@ -331,7 +336,8 @@ function runEmmetCommand(editor) { for (var command in keymap) { exports.commands.addCommand({ - name: command, + name: "emmet:" + command, + action: command, bindKey: keymap[command], exec: runEmmetCommand });