Browse Source

Merge pull request #817 from herby/syntax-colouring

Setting the right shim dependencies to have syntax colouring
Nicolas Petton 11 years ago
parent
commit
94566fc507
4 changed files with 24 additions and 17 deletions
  1. 8 7
      js/IDE.js
  2. 7 6
      st/IDE.st
  3. 6 0
      support/amber.js
  4. 3 4
      support/codemirror.js

+ 8 - 7
js/IDE.js

@@ -945,16 +945,17 @@ fn: function (aTextarea){
 var self=this;
 self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
 		theme: 'default',
-				lineNumbers: true,
-				enterMode: 'flat',
-				indentWithTabs: true,
-				indentUnit: 4,
-				matchBrackets: true,
-				electricChars: false
+		mode: 'text/x-stsrc',
+		lineNumbers: true,
+		enterMode: 'flat',
+		indentWithTabs: true,
+		indentUnit: 4,
+		matchBrackets: true,
+		electricChars: false
 	});
 return self},
 args: ["aTextarea"],
-source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'default',\x0a\x09\x09\x09\x09lineNumbers: true,\x0a\x09\x09\x09\x09enterMode: 'flat',\x0a\x09\x09\x09\x09indentWithTabs: true,\x0a\x09\x09\x09\x09indentUnit: 4,\x0a\x09\x09\x09\x09matchBrackets: true,\x0a\x09\x09\x09\x09electricChars: false\x0a\x09})>",
+source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'default',\x0a\x09\x09mode: 'text/x-stsrc',\x0a\x09\x09lineNumbers: true,\x0a\x09\x09enterMode: 'flat',\x0a\x09\x09indentWithTabs: true,\x0a\x09\x09indentUnit: 4,\x0a\x09\x09matchBrackets: true,\x0a\x09\x09electricChars: false\x0a\x09})>",
 messageSends: [],
 referencedClasses: []
 }),

+ 7 - 6
st/IDE.st

@@ -211,12 +211,13 @@ selection
 setEditorOn: aTextarea
 	<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {
 		theme: 'default',
-				lineNumbers: true,
-				enterMode: 'flat',
-				indentWithTabs: true,
-				indentUnit: 4,
-				matchBrackets: true,
-				electricChars: false
+		mode: 'text/x-stsrc',
+		lineNumbers: true,
+		enterMode: 'flat',
+		indentWithTabs: true,
+		indentUnit: 4,
+		matchBrackets: true,
+		electricChars: false
 	})>
 !
 

+ 6 - 0
support/amber.js

@@ -85,6 +85,12 @@ require = function (require) {
             'amber_lib/jquery-tabby/jquery.textarea': {
                 deps: [ 'jquery' ]
             },
+            'amber_core/IDE': {
+                deps: [ 'amber_lib/codemirror/mode/smalltalk/smalltalk' ]
+            },
+            'amber_lib/codemirror/mode/smalltalk/smalltalk': {
+                deps: [ '../../lib/codemirror' ]
+            },
             'amber_lib/codemirror/addon/hint/show-hint': {
                 deps: [ '../../lib/codemirror' ]
             },

+ 3 - 4
support/codemirror.js

@@ -1,9 +1,8 @@
-define(["amber_lib/codemirror/lib/codemirror"], function () {
-	define([
+define([
+		'amber_lib/codemirror/lib/codemirror',
 		'amber_lib/codemirror/mode/smalltalk/smalltalk',
 		'amber_lib/codemirror/addon/hint/show-hint',
 		'css!amber_lib/codemirror/theme/ambiance',
 		'css!amber_lib/codemirror/lib/codemirror',
 		'css!amber_lib/codemirror/addon/hint/show-hint'
-	]);
-});
+]);