From 563a38700d7531fe016ff9378f92439e3444dbfe Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 2 May 2013 12:59:29 +0400 Subject: [PATCH] fix #1407 Emmet breaks blockindent --- lib/ace/ext/emmet.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 });