[squeak-dev] The Trunk: Tools-eem.1004.mcz

commits at source.squeak.org commits at source.squeak.org
Tue Oct 20 00:17:10 UTC 2020


Eliot Miranda uploaded a new version of Tools to project The Trunk:
http://source.squeak.org/trunk/Tools-eem.1004.mcz

==================== Summary ====================

Name: Tools-eem.1004
Author: eem
Time: 19 October 2020, 5:17:08.08257 pm
UUID: 8680e986-a863-4369-bc29-967b005c4851
Ancestors: Tools-eem.1003

Integrate Javier Diaz-Reinoso;s kindly contributed improvement to Workspace file editing.

=============== Diff against Tools-eem.1003 ===============

Item was changed:
  ----- Method: FileList>>viewContentsInWorkspace (in category 'own services') -----
  viewContentsInWorkspace
  	"View the contents of my selected file in a new workspace"
  	
+ 	| aFileStream aName lineConversion w | 
+ 	aFileStream := (directory readOnlyFileNamed: self fullName) setConverterForCode.
+ 	aFileStream wantsLineEndConversion: true.
+ 	lineConversion := aFileStream detectLineEndConvention.
- 	| aString aFileStream aName |
- 	aString := (aFileStream := directory readOnlyFileNamed: self fullName) setConverterForCode contentsOfEntireFile.
  	aName := aFileStream localName.
+ 	w:= UIManager default
+ 			edit: ([aFileStream contentsOfEntireFile] ensure: [aFileStream close])
+ 			label: ((aName includesSubstring: 'Workspace')
+ 					ifTrue: [(aName endsWith: '.text') ifTrue: [aName allButLast: 5] ifFalse: [aName]]
+ 					ifFalse: ['Workspace from ', aName]).
+ 	w setProperty: #lineConversion toValue: lineConversion.
+ 	directory ~= FileDirectory default ifTrue: [w setProperty: #myDir toValue: directory]!
- 	aFileStream close.
- 	UIManager default edit: aString withSqueakLineEndings label: 'Workspace from ', aName!



More information about the Squeak-dev mailing list