From a78ceb6daff37e8777fb75d1653042fb6a54ad4a Mon Sep 17 00:00:00 2001 From: c-spencer Date: Tue, 31 May 2011 12:19:21 +0100 Subject: [PATCH 1/2] Fixes for #275 --- lib/ace/mode/behaviour/cstyle.js | 2 +- lib/ace/mode/html_highlight_rules.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ace/mode/behaviour/cstyle.js b/lib/ace/mode/behaviour/cstyle.js index d685ad06..a85f796b 100644 --- a/lib/ace/mode/behaviour/cstyle.js +++ b/lib/ace/mode/behaviour/cstyle.js @@ -186,7 +186,7 @@ var CstyleBehaviour = function () { } // Try and be smart about when we auto insert. - if (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf('"') === token.value.length-1))) { + if (!token || (quotepos < 0 && token.type !== "comment" && (token.type !== "string" || ((selection.start.column !== token.value.length+col-1) && token.value.lastIndexOf('"') === token.value.length-1)))) { return { text: '""', selection: [1,1] diff --git a/lib/ace/mode/html_highlight_rules.js b/lib/ace/mode/html_highlight_rules.js index 8a1f3e53..d02fb6f8 100644 --- a/lib/ace/mode/html_highlight_rules.js +++ b/lib/ace/mode/html_highlight_rules.js @@ -131,7 +131,7 @@ var HtmlHighlightRules = function() { }, { token : "text", regex : "\\s+" - }].concat(string("css")), + }].concat(string("style")), tag : [ { token : "text", @@ -145,8 +145,8 @@ var HtmlHighlightRules = function() { regex : "\\s+" }].concat(string("tag")), - "css-qstring": multiLineString("'", "css"), - "css-qqstring": multiLineString('"', "css"), + "style-qstring": multiLineString("'", "style"), + "style-qqstring": multiLineString('"', "style"), "script-qstring": multiLineString("'", "script"), "script-qqstring": multiLineString('"', "script"), "tag-qstring": multiLineString("'", "tag"), From 874e310f64cc18e525dd3b68a418fa0bbb5f584b Mon Sep 17 00:00:00 2001 From: misfo Date: Wed, 1 Jun 2011 20:52:49 -0500 Subject: [PATCH 2/2] fix comment typos --- lib/ace/keyboard/state_handler.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ace/keyboard/state_handler.js b/lib/ace/keyboard/state_handler.js index b887cd4d..fd443acd 100644 --- a/lib/ace/keyboard/state_handler.js +++ b/lib/ace/keyboard/state_handler.js @@ -140,11 +140,11 @@ StateHandler.prototype = { } // If there is a command to execute, then figure out the - // comand and the arguments. + // command and the arguments. if (binding.exec) { result.command = binding.exec; - // Bulid the arguments. + // Build the arguments. if (binding.params) { var value; result.args = {};