Forráskód Böngészése

Backport editor changes to helios

Nicolas Petton 11 éve
szülő
commit
9e971442a7
3 módosított fájl, 71 hozzáadás és 1 törlés
  1. 24 0
      js/Helios-Workspace.deploy.js
  2. 35 1
      js/Helios-Workspace.js
  3. 12 0
      st/Helios-Workspace.st

+ 24 - 0
js/Helios-Workspace.deploy.js

@@ -536,6 +536,7 @@ return smalltalk.withContext(function($ctx1) { 
self['@editor'] = CodeMirror.fro
                 lineNumbers: true,
                 enterMode: 'flat',
                 matchBrackets: true,
+                indentWithTabs: true,
                 electricChars: false
 	});
 return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea}, smalltalk.HLCodeWidget)})},
@@ -543,6 +544,29 @@ messageSends: []}),
 smalltalk.HLCodeWidget);
 
 
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
+_st(self)._setupCodeMirror();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLCodeWidget.klass)})},
+messageSends: ["initialize", "setupCodeMirror"]}),
+smalltalk.HLCodeWidget.klass);
+
+smalltalk.addMethod(
+"_setupCodeMirror",
+smalltalk.method({
+selector: "setupCodeMirror",
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
 CodeMirror.keyMap.default.fallthrough = ["basic"] ;
+return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{}, smalltalk.HLCodeWidget.klass)})},
+messageSends: []}),
+smalltalk.HLCodeWidget.klass);
+
 
 smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLCodeWidget, [], 'Helios-Workspace');
 smalltalk.addMethod(

+ 35 - 1
js/Helios-Workspace.js

@@ -722,17 +722,51 @@ return smalltalk.withContext(function($ctx1) { 
self['@editor'] = CodeMirror.fro
                 lineNumbers: true,
                 enterMode: 'flat',
                 matchBrackets: true,
+                indentWithTabs: true,
                 electricChars: false
 	});
 return self}, function($ctx1) {$ctx1.fill(self,"setEditorOn:",{aTextarea:aTextarea}, smalltalk.HLCodeWidget)})},
 args: ["aTextarea"],
-source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a                lineNumbers: true,\x0a                enterMode: 'flat',\x0a                matchBrackets: true,\x0a                electricChars: false\x0a\x09})>",
+source: "setEditorOn: aTextarea\x0a\x09<self['@editor'] = CodeMirror.fromTextArea(aTextarea, {\x0a\x09\x09theme: 'amber',\x0a                lineNumbers: true,\x0a                enterMode: 'flat',\x0a                matchBrackets: true,\x0a                indentWithTabs: true,\x0a                electricChars: false\x0a\x09})>",
 messageSends: [],
 referencedClasses: []
 }),
 smalltalk.HLCodeWidget);
 
 
+smalltalk.addMethod(
+"_initialize",
+smalltalk.method({
+selector: "initialize",
+category: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
smalltalk.HLWidget.klass.fn.prototype._initialize.apply(_st(self), []);
+_st(self)._setupCodeMirror();
+return self}, function($ctx1) {$ctx1.fill(self,"initialize",{}, smalltalk.HLCodeWidget.klass)})},
+args: [],
+source: "initialize\x0a\x09super initialize.\x0a\x09self setupCodeMirror",
+messageSends: ["initialize", "setupCodeMirror"],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget.klass);
+
+smalltalk.addMethod(
+"_setupCodeMirror",
+smalltalk.method({
+selector: "setupCodeMirror",
+category: 'initialization',
+fn: function (){
+var self=this;
+return smalltalk.withContext(function($ctx1) { 
 CodeMirror.keyMap.default.fallthrough = ["basic"] ;
+return self}, function($ctx1) {$ctx1.fill(self,"setupCodeMirror",{}, smalltalk.HLCodeWidget.klass)})},
+args: [],
+source: "setupCodeMirror\x0a\x09< CodeMirror.keyMap.default.fallthrough = [\x22basic\x22] >",
+messageSends: [],
+referencedClasses: []
+}),
+smalltalk.HLCodeWidget.klass);
+
 
 smalltalk.addClass('HLSourceCodeWidget', smalltalk.HLCodeWidget, [], 'Helios-Workspace');
 smalltalk.addMethod(

+ 12 - 0
st/Helios-Workspace.st

@@ -200,6 +200,7 @@ setEditorOn: aTextarea
                 lineNumbers: true,
                 enterMode: 'flat',
                 matchBrackets: true,
+                indentWithTabs: true,
                 electricChars: false
 	})>
 ! !
@@ -251,6 +252,17 @@ renderContentOn: html
     self observeWrapper
 ! !
 
+!HLCodeWidget class methodsFor: 'initialization'!
+
+initialize
+	super initialize.
+	self setupCodeMirror
+!
+
+setupCodeMirror
+	< CodeMirror.keyMap.default.fallthrough = ["basic"] >
+! !
+
 HLCodeWidget subclass: #HLSourceCodeWidget
 	instanceVariableNames: ''
 	package: 'Helios-Workspace'!