From a774f9052d5bb45a1800af6eaa047c1b6d136b07 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 18 Feb 2013 09:58:27 +0000 Subject: [PATCH] Tag wrap on a tag cursor pos & other Esc = cancel Need to set cursor position to start line, not end Accidentally removed cancel shortcut --- lib/ice-coder.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/ice-coder.js b/lib/ice-coder.js index 7c69683..34936ff 100644 --- a/lib/ice-coder.js +++ b/lib/ice-coder.js @@ -370,7 +370,7 @@ var ICEcoder = { if (tag=='a') {tagStart='a href=""';} cM.replaceSelection("<"+tagStart+">"+cM.getSelection()+""); } - if (tag=='a') {cM.setCursor({line:cM.getCursor().line,ch:cM.getCursor('start').ch+9})} + if (tag=='a') {cM.setCursor({line:cM.getCursor('start').line,ch:cM.getCursor('start').ch+9})} }, // ============== @@ -2022,6 +2022,11 @@ var ICEcoder = { top.ICEcoder.lineCommentToggle(); return false; + // ESC not in content area (Cancel all actions) + } else if(key==27 && area != "content") { + top.ICEcoder.cancelAllActions(); + return false; + // Any other key } else { return key;