Ver Fonte

Set editor in smalltalk syntax.

Herby Vojčík há 6 anos atrás
pai
commit
8e96645963
2 ficheiros alterados com 13 adições e 22 exclusões
  1. 3 12
      src/IDE.js
  2. 10 10
      src/IDE.st

+ 3 - 12
src/IDE.js

@@ -1294,16 +1294,7 @@ var self=this,$self=this;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 return $core.withContext(function($ctx1) {
 //>>excludeEnd("ctx");
-$self.editor = codeMirrorLib.fromTextArea(aTextarea, {
-		theme: "ide.codeMirrorTheme"._settingValueIfAbsent_("default"),
-		mode: "text/x-stsrc",
-		lineNumbers: true,
-		enterMode: "flat",
-		indentWithTabs: true,
-		indentUnit: 4,
-		matchBrackets: true,
-		electricChars: false
-	});
+$self.editor=$recv($recv(codeMirrorLib)._provided())._fromTextArea_options_(aTextarea,$globals.HashedCollection._newFromPairs_(["theme","ide.codeMirrorTheme"._settingValueIfAbsent_("default"),"mode","text/x-stsrc","lineNumbers",true,"enterMode","flat","indentWithTabs",true,"indentUnit",(4),"matchBrackets",true,"electricChars",false]));
 return self;
 //>>excludeStart("ctx", pragmas.excludeDebugContexts);
 }, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea},$globals.SourceArea)});
@@ -1311,10 +1302,10 @@ return self;
 },
 //>>excludeStart("ide", pragmas.excludeIdeData);
 args: ["aTextarea"],
-source: "setEditorOn: aTextarea\x0a\x09<inlineJS: '$self.editor = codeMirrorLib.fromTextArea(aTextarea, {\x0a\x09\x09theme: \x22ide.codeMirrorTheme\x22._settingValueIfAbsent_(\x22default\x22),\x0a\x09\x09mode: \x22text/x-stsrc\x22,\x0a\x09\x09lineNumbers: true,\x0a\x09\x09enterMode: \x22flat\x22,\x0a\x09\x09indentWithTabs: true,\x0a\x09\x09indentUnit: 4,\x0a\x09\x09matchBrackets: true,\x0a\x09\x09electricChars: false\x0a\x09})'>",
+source: "setEditorOn: aTextarea\x0a\x09editor := codeMirrorLib provided fromTextArea: aTextarea options: #{\x0a\x09\x09#theme -> ('ide.codeMirrorTheme' settingValueIfAbsent: 'default').\x0a\x09\x09#mode -> 'text/x-stsrc'.\x0a\x09\x09#lineNumbers -> true.\x0a\x09\x09#enterMode -> 'flat'.\x0a\x09\x09#indentWithTabs -> true.\x0a\x09\x09#indentUnit -> 4.\x0a\x09\x09#matchBrackets -> true.\x0a\x09\x09#electricChars -> false\x0a\x09}",
 referencedClasses: [],
 //>>excludeEnd("ide");
-messageSends: []
+messageSends: ["fromTextArea:options:", "provided", "settingValueIfAbsent:"]
 }),
 $globals.SourceArea);
 

+ 10 - 10
src/IDE.st

@@ -210,16 +210,16 @@ selection
 !
 
 setEditorOn: aTextarea
-	<inlineJS: '$self.editor = codeMirrorLib.fromTextArea(aTextarea, {
-		theme: "ide.codeMirrorTheme"._settingValueIfAbsent_("default"),
-		mode: "text/x-stsrc",
-		lineNumbers: true,
-		enterMode: "flat",
-		indentWithTabs: true,
-		indentUnit: 4,
-		matchBrackets: true,
-		electricChars: false
-	})'>
+	editor := codeMirrorLib provided fromTextArea: aTextarea options: #{
+		#theme -> ('ide.codeMirrorTheme' settingValueIfAbsent: 'default').
+		#mode -> 'text/x-stsrc'.
+		#lineNumbers -> true.
+		#enterMode -> 'flat'.
+		#indentWithTabs -> true.
+		#indentUnit -> 4.
+		#matchBrackets -> true.
+		#electricChars -> false
+	}
 !
 
 val