From 6aa2d0e533c1d5f23d5089b1ef1997a148a4f600 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Tue, 22 Oct 2013 18:07:32 +0100 Subject: [PATCH] CSS hinting now on SQL, CSS and XML Applied with a smarter approach to the code here --- editor.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/editor.php b/editor.php index 8fd9a0f..b33d918 100644 --- a/editor.php +++ b/editor.php @@ -149,13 +149,11 @@ CodeMirror.keyMap.ICEcoder = { fallthrough: ["default"] }; CodeMirror.commands.autocomplete = function(cm) { - CodeMirror.showHint(cm, - top.ICEcoder.caretLocType=="JavaScript" - ? CodeMirror.hint.javascript - : top.ICEcoder.caretLocType=="CoffeeScript" - ? CodeMirror.hint.coffeescript - : CodeMirror.hint.html - ); + var langType = top.ICEcoder.caretLocType; + if (["JavaScript","CoffeeScript","SQL","CSS","HTML","XML","Content"].indexOf(langType)>-1) { + if (langType=="XML"||langType=="Content") {langType="HTML"}; + CodeMirror.showHint(cm,CodeMirror.hint[langType.toLowerCase()]); + } } function createNewCMInstance(num) {